fit-ui 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Fit.UI.js CHANGED
@@ -648,7 +648,7 @@ Fit._internal =
648
648
  {
649
649
  Core:
650
650
  {
651
- VersionInfo: { Major: 2, Minor: 8, Patch: 0 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
651
+ VersionInfo: { Major: 2, Minor: 8, Patch: 1 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
652
652
  }
653
653
  };
654
654
 
@@ -21651,6 +21651,7 @@ Fit.Controls.Input = function(ctlId)
21651
21651
  var designEditorDirty = false;
21652
21652
  var designEditorDirtyPending = false;
21653
21653
  var designEditorConfig = null;
21654
+ var designEditorReloadConfig = null;
21654
21655
  var designEditorRestoreButtonState = null;
21655
21656
  var designEditorSuppressPaste = false;
21656
21657
  var designEditorSuppressOnResize = false;
@@ -22205,7 +22206,7 @@ Fit.Controls.Input = function(ctlId)
22205
22206
  });
22206
22207
  }
22207
22208
 
22208
- me = orgVal = preVal = input = cmdResize = designEditor = designEditorDom = designEditorDirty = designEditorDirtyPending = designEditorConfig = designEditorRestoreButtonState = designEditorSuppressPaste = designEditorSuppressOnResize = designEditorMustReloadWhenReady = designEditorMustDisposeWhenReady = designEditorUpdateSizeDebouncer = designEditorActiveToolbarPanel /*= htmlWrappedInParagraph*/ = wasAutoChangedToMultiLineMode = minimizeHeight = maximizeHeight = minMaxUnit = maximizeHeightConfigured = resizable = nativeResizableAvailable = mutationObserverId = rootedEventId = createWhenReadyIntervalId = isIe8 = debounceOnChangeTimeout = debouncedOnChange = imageBlobUrls = null;
22209
+ me = orgVal = preVal = input = cmdResize = designEditor = designEditorDom = designEditorDirty = designEditorDirtyPending = designEditorConfig = designEditorReloadConfig = designEditorRestoreButtonState = designEditorSuppressPaste = designEditorSuppressOnResize = designEditorMustReloadWhenReady = designEditorMustDisposeWhenReady = designEditorUpdateSizeDebouncer = designEditorActiveToolbarPanel /*= htmlWrappedInParagraph*/ = wasAutoChangedToMultiLineMode = minimizeHeight = maximizeHeight = minMaxUnit = maximizeHeightConfigured = resizable = nativeResizableAvailable = mutationObserverId = rootedEventId = createWhenReadyIntervalId = isIe8 = debounceOnChangeTimeout = debouncedOnChange = imageBlobUrls = null;
22209
22210
 
22210
22211
  base();
22211
22212
  });
@@ -22958,12 +22959,9 @@ Fit.Controls.Input = function(ctlId)
22958
22959
  if (Fit._internal.Controls.Input.ActiveEditorForDialog === me && Fit._internal.Controls.Input.ActiveEditorForDialogDisabledPostponed === true)
22959
22960
  designMode = false; // Not considered in Design Mode if scheduled to be disabled (postponed because a dialog is currently loading)
22960
22961
 
22961
- if (val === true && designMode === false)
22962
+ if ((val === true && designMode === false) || (val === true && Fit.Validation.IsSet(editorConfig) === true && Fit.Core.IsEqual(editorConfig, designEditorConfig) === false))
22962
22963
  {
22963
- if (Fit.Validation.IsSet(editorConfig) === true)
22964
- {
22965
- designEditorConfig = Fit.Core.Clone(editorConfig); // Clone to prevent external code from making changes later
22966
- }
22964
+ var configUpdated = designMode === true; // Already in DesignMode which means editorConfig was changed
22967
22965
 
22968
22966
  if (Fit._internal.Controls.Input.ActiveEditorForDialog === me)
22969
22967
  {
@@ -22971,7 +22969,22 @@ Fit.Controls.Input = function(ctlId)
22971
22969
  // for dialog to finish loading, so DesignMode can be disabled (scheduled).
22972
22970
  // Remove flag responsible for disabling DesignMode so it remains an editor.
22973
22971
  delete Fit._internal.Controls.Input.ActiveEditorForDialogDisabledPostponed;
22974
- return;
22972
+
22973
+ if (configUpdated === false)
22974
+ {
22975
+ return true;
22976
+ }
22977
+ }
22978
+
22979
+ if (configUpdated === true)
22980
+ {
22981
+ reloadEditor(false, Fit.Core.Clone(editorConfig)); // Clone to prevent external code from making changes later
22982
+ return true;
22983
+ }
22984
+
22985
+ if (Fit.Validation.IsSet(editorConfig) === true)
22986
+ {
22987
+ designEditorConfig = Fit.Core.Clone(editorConfig); // Clone to prevent external code from making changes later
22975
22988
  }
22976
22989
 
22977
22990
  if (me.MultiLine() === false)
@@ -23340,7 +23353,7 @@ Fit.Controls.Input = function(ctlId)
23340
23353
  }
23341
23354
  }, 5000); // Usually the load time for a dialog is barely measurable, so 5 seconds seems sufficient */
23342
23355
 
23343
- return;
23356
+ return true; // Return current un-modified state - DesignMode remains enabled until dialog is done loading
23344
23357
  }
23345
23358
  }
23346
23359
 
@@ -24528,15 +24541,17 @@ Fit.Controls.Input = function(ctlId)
24528
24541
  }
24529
24542
  }
24530
24543
 
24531
- function reloadEditor(force)
24544
+ function reloadEditor(force, reloadConfig)
24532
24545
  {
24533
24546
  Fit.Validation.ExpectBoolean(force, true);
24547
+ Fit.Validation.ExpectObject(reloadConfig, true); // Not validated further, as it has already been validated in DesignMode(..)
24534
24548
 
24535
24549
  if (force !== true && (designModeEnabledAndReady() === false || designEditorMustReloadWhenReady === true))
24536
24550
  {
24537
24551
  // Attempting to reload editor while initializing - postpone until editor is fully loaded,
24538
24552
  // since we cannot guarantee reliable behavior with CKEditor if it's disposed while loading.
24539
24553
  designEditorMustReloadWhenReady = true;
24554
+ designEditorReloadConfig = reloadConfig || designEditorReloadConfig;
24540
24555
  return;
24541
24556
  }
24542
24557
 
@@ -24551,7 +24566,8 @@ Fit.Controls.Input = function(ctlId)
24551
24566
  var currentWasAutoChangedToMultiLineMode = wasAutoChangedToMultiLineMode; // DesignMode(false) will result in wasAutoChangedToMultiLineMode being set to false if DesignMode(true) changed the control to MultiLine mode
24552
24567
 
24553
24568
  me.DesignMode(false);
24554
- me.DesignMode(true);
24569
+ me.DesignMode(true, reloadConfig || designEditorReloadConfig || undefined); // Use reloadConfig if set (and if reload was not postponed) or use designEditorReloadConfig if reload was postponed with updated editor config
24570
+ designEditorReloadConfig = null;
24555
24571
 
24556
24572
  me.Height(height.Value, height.Unit);
24557
24573
  wasAutoChangedToMultiLineMode = currentWasAutoChangedToMultiLineMode;
@@ -24576,6 +24592,7 @@ Fit.Controls.Input = function(ctlId)
24576
24592
  designEditorDirty = false;
24577
24593
  designEditorDirtyPending = false;
24578
24594
  //designEditorConfig = null; // Do NOT nullify this! We need it, in case DesignMode is toggled!
24595
+ //designEditorReloadConfig = null; // Do NOT nullify this! We need it, in case DesignMode is reloaded!
24579
24596
  designEditorRestoreButtonState = null;
24580
24597
  designEditorSuppressPaste = false;
24581
24598
  designEditorSuppressOnResize = false;