@syncfusion/ej2-image-editor 22.2.8 → 22.2.10

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.
@@ -9370,8 +9370,10 @@ class Selection {
9370
9370
  isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
9371
9371
  }
9372
9372
  else if (parent.activeObj.shape === 'text') {
9373
- parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
9374
- isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
9373
+ if (parent.textArea.style.display === 'none') {
9374
+ parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
9375
+ isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
9376
+ }
9375
9377
  }
9376
9378
  else if (this.isFhdEditing) {
9377
9379
  parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
@@ -9388,7 +9390,7 @@ class Selection {
9388
9390
  || (parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path')) {
9389
9391
  parent.updateToolbar(parent.element, parent.activeObj.shape);
9390
9392
  }
9391
- else if (parent.activeObj.shape === 'text') {
9393
+ else if (parent.activeObj.shape === 'text' && parent.textArea.style.display === 'none') {
9392
9394
  parent.updateToolbar(parent.element, 'text');
9393
9395
  }
9394
9396
  }
@@ -9703,23 +9705,24 @@ class Selection {
9703
9705
  parent.activeObj = extend({}, activeObj, null, true);
9704
9706
  parent.textArea.value = obj.keyHistory;
9705
9707
  parent.textArea.style.display = 'block';
9706
- let strokeColor = obj.strokeSettings.strokeColor.split('(')[0] === 'rgb' ?
9708
+ let strokeColor = obj.strokeSettings && obj.strokeSettings.strokeColor ? obj.strokeSettings.strokeColor.split('(')[0] === 'rgb' ?
9707
9709
  this.rgbToHex(parseFloat(obj.strokeSettings.strokeColor.split('(')[1].split(',')[0]), parseFloat(obj.strokeSettings.strokeColor.split('(')[1].split(',')[1]), parseFloat(obj.strokeSettings.strokeColor.split('(')[1].split(',')[2])) :
9708
- obj.strokeSettings.strokeColor;
9709
- if (strokeColor === '#ffffff') {
9710
+ obj.strokeSettings.strokeColor : null;
9711
+ if (strokeColor && strokeColor === '#ffffff') {
9710
9712
  strokeColor = '#fff';
9711
9713
  }
9712
- if (this.tempActiveObj.strokeSettings.strokeColor === '#ffffff') {
9714
+ if (this.tempActiveObj.strokeSettings && this.tempActiveObj.strokeSettings.strokeColor &&
9715
+ this.tempActiveObj.strokeSettings.strokeColor === '#ffffff') {
9713
9716
  this.tempActiveObj.strokeSettings.strokeColor = '#fff';
9714
9717
  }
9715
9718
  if (obj.keyHistory !== this.tempActiveObj.keyHistory ||
9716
- strokeColor !== this.tempActiveObj.strokeSettings.strokeColor ||
9717
- obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily ||
9718
- Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize) ||
9719
- Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio) ||
9720
- obj.textSettings.bold !== this.tempActiveObj.textSettings.bold ||
9721
- obj.textSettings.italic !== this.tempActiveObj.textSettings.italic ||
9722
- obj.textSettings.underline !== this.tempActiveObj.textSettings.underline) {
9719
+ (strokeColor && (strokeColor !== this.tempActiveObj.strokeSettings.strokeColor)) ||
9720
+ (obj.textSettings && obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily) ||
9721
+ (obj.textSettings && Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize)) ||
9722
+ (obj.textSettings && Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio)) ||
9723
+ (obj.textSettings && obj.textSettings.bold !== this.tempActiveObj.textSettings.bold) ||
9724
+ (obj.textSettings && obj.textSettings.italic !== this.tempActiveObj.textSettings.italic) ||
9725
+ (obj.textSettings && obj.textSettings.underline !== this.tempActiveObj.textSettings.underline)) {
9723
9726
  isApply = true;
9724
9727
  }
9725
9728
  if (this.isInitialTextEdited && !isApply) {
@@ -10465,6 +10468,9 @@ class Selection {
10465
10468
  isInside = true;
10466
10469
  }
10467
10470
  }
10471
+ else if (parent.textArea.style.display === 'block') {
10472
+ isInside = true;
10473
+ }
10468
10474
  if (!isInside) {
10469
10475
  if (isNullOrUndefined(parent.activeObj.currIndex)) {
10470
10476
  parent.activeObj.currIndex = 'shape_' + (parent.objColl.length + 1);
@@ -11392,6 +11398,7 @@ class Shape {
11392
11398
  parent.textArea.style.transform = '';
11393
11399
  parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
11394
11400
  }
11401
+ this.refreshActiveObj();
11395
11402
  }
11396
11403
  else {
11397
11404
  this.applyActObj(isMouseDown);
@@ -19363,26 +19370,36 @@ class ToolbarModule {
19363
19370
  }
19364
19371
  renderAnnotationBtn(isContextualToolbar) {
19365
19372
  const parent = this.parent;
19373
+ let isCustomized = false;
19366
19374
  const items = [];
19367
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
19375
+ const defItems = ['Ellipse', 'Arrow', 'Line', 'Rectangle', 'Pen', 'Path', 'Text'];
19376
+ if (parent.toolbar) {
19377
+ for (let i = 0; i < defItems.length; i++) {
19378
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
19379
+ isCustomized = true;
19380
+ break;
19381
+ }
19382
+ }
19383
+ }
19384
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
19368
19385
  items.push({ text: this.l10n.getConstant('Pen'), id: 'pen', iconCss: 'e-icons e-free-pen' });
19369
19386
  }
19370
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
19387
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
19371
19388
  items.push({ text: this.l10n.getConstant('Line'), id: 'line', iconCss: 'e-icons e-line' });
19372
19389
  }
19373
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
19390
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
19374
19391
  items.push({ text: this.l10n.getConstant('Rectangle'), id: 'rectangle', iconCss: 'e-icons e-rectangle' });
19375
19392
  }
19376
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
19393
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
19377
19394
  items.push({ text: this.l10n.getConstant('Ellipse'), id: 'ellipse', iconCss: 'e-icons e-circle' });
19378
19395
  }
19379
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
19396
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
19380
19397
  items.push({ text: this.l10n.getConstant('Arrow'), id: 'arrow', iconCss: 'e-icons e-arrow-right-up' });
19381
19398
  }
19382
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
19399
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
19383
19400
  items.push({ text: this.l10n.getConstant('Path'), id: 'path', iconCss: 'e-icons e-critical-path' });
19384
19401
  }
19385
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
19402
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
19386
19403
  items.push({ text: this.l10n.getConstant('Text'), id: 'text', iconCss: 'e-icons e-add-text' });
19387
19404
  }
19388
19405
  const obj = { freehandDrawSelectedId: null };
@@ -19486,16 +19503,26 @@ class ToolbarModule {
19486
19503
  renderCropBtn() {
19487
19504
  const parent = this.parent;
19488
19505
  const items = [];
19489
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
19506
+ let isCustomized = false;
19507
+ const defItems = ['CustomSelection', 'CircleSelection', 'SquareSelection', 'RatioSelection'];
19508
+ if (parent.toolbar) {
19509
+ for (let i = 0; i < defItems.length; i++) {
19510
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
19511
+ isCustomized = true;
19512
+ break;
19513
+ }
19514
+ }
19515
+ }
19516
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
19490
19517
  items.push({ text: this.l10n.getConstant('Custom'), id: 'custom', iconCss: 'e-icons e-custom' });
19491
19518
  }
19492
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
19519
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
19493
19520
  items.push({ text: this.l10n.getConstant('Circle'), id: 'circle', iconCss: 'e-icons e-circle' });
19494
19521
  }
19495
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
19522
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
19496
19523
  items.push({ text: this.l10n.getConstant('Square'), id: 'square', iconCss: 'e-icons e-square' });
19497
19524
  }
19498
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
19525
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
19499
19526
  items.push({ text: '3:2', id: '3:2', iconCss: 'e-icons e-custom-a' });
19500
19527
  items.push({ text: '4:3', id: '4:3', iconCss: 'e-icons e-custom-b' });
19501
19528
  items.push({ text: '5:4', id: '5:4', iconCss: 'e-icons e-custom-c' });
@@ -19513,8 +19540,8 @@ class ToolbarModule {
19513
19540
  shape = parent.currSelectionPoint.shape;
19514
19541
  }
19515
19542
  else {
19516
- iconCss = 'e-custom';
19517
- shape = 'custom';
19543
+ iconCss = items[0].iconCss;
19544
+ shape = items[0].id;
19518
19545
  }
19519
19546
  const drpDownBtn = new DropDownButton({
19520
19547
  open: (args) => {
@@ -19596,15 +19623,29 @@ class ToolbarModule {
19596
19623
  template: '<button id="' + parent.element.id + '_cropBtn"></button>'
19597
19624
  });
19598
19625
  toolbarItems.push({ align: 'Center', type: 'Separator' });
19599
- toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
19600
- tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
19601
- toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
19602
- tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
19603
- toolbarItems.push({ align: 'Center', type: 'Separator' });
19604
- toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
19605
- tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
19606
- toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
19607
- tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
19626
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19627
+ parent.toolbar.indexOf('RotateLeft') > -1))) {
19628
+ toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
19629
+ tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
19630
+ }
19631
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19632
+ parent.toolbar.indexOf('RotateRight') > -1))) {
19633
+ toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
19634
+ tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
19635
+ }
19636
+ if (toolbarItems.length > 2) {
19637
+ toolbarItems.push({ align: 'Center', type: 'Separator' });
19638
+ }
19639
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19640
+ parent.toolbar.indexOf('HorizontalFlip') > -1))) {
19641
+ toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
19642
+ tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
19643
+ }
19644
+ if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
19645
+ parent.toolbar.indexOf('VerticalFlip') > -1))) {
19646
+ toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
19647
+ tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
19648
+ }
19608
19649
  if (!Browser.isDevice) {
19609
19650
  toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
19610
19651
  tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
@@ -19709,7 +19750,9 @@ class ToolbarModule {
19709
19750
  toolbar.refreshOverflow();
19710
19751
  }
19711
19752
  }
19712
- parent.select('custom');
19753
+ if (document.getElementById(parent.element.id + '_cropBtn')) {
19754
+ parent.select(document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase());
19755
+ }
19713
19756
  }
19714
19757
  });
19715
19758
  if (Browser.isDevice) {
@@ -20341,31 +20384,41 @@ class ToolbarModule {
20341
20384
  getAdjustmentToolbarItem() {
20342
20385
  const toolbarItems = [];
20343
20386
  const parent = this.parent;
20344
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
20387
+ let isCustomized = false;
20388
+ const defItems = ['Brightness', 'Contrast', 'Hue', 'Saturation', 'Exposure', 'Opacity', 'Blur'];
20389
+ if (parent.toolbar) {
20390
+ for (let i = 0; i < defItems.length; i++) {
20391
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
20392
+ isCustomized = true;
20393
+ break;
20394
+ }
20395
+ }
20396
+ }
20397
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
20345
20398
  toolbarItems.push({ id: parent.element.id + '_brightness', prefixIcon: 'e-icons e-brightness', cssClass: 'top-icon e-brightness',
20346
20399
  tooltipText: this.l10n.getConstant('Brightness'), align: 'Center' });
20347
20400
  }
20348
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
20401
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
20349
20402
  toolbarItems.push({ id: parent.element.id + '_contrast', prefixIcon: 'e-icons e-contrast', cssClass: 'top-icon e-contrast',
20350
20403
  tooltipText: this.l10n.getConstant('Contrast'), align: 'Center' });
20351
20404
  }
20352
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
20405
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
20353
20406
  toolbarItems.push({ id: parent.element.id + '_hue', prefixIcon: 'e-icons e-fade', cssClass: 'top-icon e-fade',
20354
20407
  tooltipText: this.l10n.getConstant('Hue'), align: 'Center' });
20355
20408
  }
20356
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
20409
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
20357
20410
  toolbarItems.push({ id: parent.element.id + '_saturation', prefixIcon: 'e-icons e-saturation', cssClass: 'top-icon e-saturation',
20358
20411
  tooltipText: this.l10n.getConstant('Saturation'), align: 'Center' });
20359
20412
  }
20360
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
20413
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
20361
20414
  toolbarItems.push({ id: parent.element.id + '_exposure', prefixIcon: 'e-icons e-grain', cssClass: 'top-icon e-grain',
20362
20415
  tooltipText: this.l10n.getConstant('Exposure'), align: 'Center' });
20363
20416
  }
20364
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
20417
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
20365
20418
  toolbarItems.push({ id: parent.element.id + '_opacity', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
20366
20419
  tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
20367
20420
  }
20368
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
20421
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
20369
20422
  toolbarItems.push({ id: parent.element.id + '_blur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-tint',
20370
20423
  tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
20371
20424
  }
@@ -20384,37 +20437,47 @@ class ToolbarModule {
20384
20437
  getFilterToolbarItem() {
20385
20438
  const toolbarItems = [];
20386
20439
  const parent = this.parent;
20387
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
20440
+ let isCustomized = false;
20441
+ const defItems = ['Default', 'Chrome', 'Cold', 'Warm', 'Grayscale', 'Sepia', 'Invert'];
20442
+ if (parent.toolbar) {
20443
+ for (let i = 0; i < defItems.length; i++) {
20444
+ if (parent.toolbar.indexOf(defItems[i]) !== -1) {
20445
+ isCustomized = true;
20446
+ break;
20447
+ }
20448
+ }
20449
+ }
20450
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
20388
20451
  toolbarItems.push({ id: parent.element.id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20389
20452
  tooltipText: this.l10n.getConstant('Default'), align: 'Center',
20390
20453
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_defaultCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Default') + '</span></div></div>' });
20391
20454
  }
20392
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
20455
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
20393
20456
  toolbarItems.push({ id: parent.element.id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20394
20457
  tooltipText: this.l10n.getConstant('Chrome'), align: 'Center',
20395
20458
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_chromeCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Chrome') + '</span></div></div>' });
20396
20459
  }
20397
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
20460
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
20398
20461
  toolbarItems.push({ id: parent.element.id + '_cold', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20399
20462
  tooltipText: this.l10n.getConstant('Cold'), align: 'Center',
20400
20463
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_coldCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Cold') + '</span></div></div>' });
20401
20464
  }
20402
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
20465
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
20403
20466
  toolbarItems.push({ id: parent.element.id + '_warm', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20404
20467
  tooltipText: this.l10n.getConstant('Warm'), align: 'Center',
20405
20468
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_warmCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Warm') + '</span></div></div>' });
20406
20469
  }
20407
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
20470
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
20408
20471
  toolbarItems.push({ id: parent.element.id + '_grayscale', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20409
20472
  tooltipText: this.l10n.getConstant('Grayscale'), align: 'Center',
20410
20473
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_grayscaleCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Grayscale') + '</span></div></div>' });
20411
20474
  }
20412
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
20475
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
20413
20476
  toolbarItems.push({ id: parent.element.id + '_sepia', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20414
20477
  tooltipText: this.l10n.getConstant('Sepia'), align: 'Center',
20415
20478
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_sepiaCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Sepia') + '</span></div></div>' });
20416
20479
  }
20417
- if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
20480
+ if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
20418
20481
  toolbarItems.push({ id: parent.element.id + '_invert', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
20419
20482
  tooltipText: this.l10n.getConstant('Invert'), align: 'Center',
20420
20483
  template: '<div class="filter-wrapper" style="box-sizing: content-box;"><canvas id=' + parent.element.id + '_invertCanvas' + '></canvas><div style="text-align:center;"><span>' + this.l10n.getConstant('Invert') + '</span></div></div>' });
@@ -20684,7 +20747,9 @@ class ToolbarModule {
20684
20747
  if (hdrWrapper) {
20685
20748
  hdrWrapper.style.display = 'none';
20686
20749
  }
20687
- document.getElementById(parent.currentFilter + 'Canvas').parentElement.parentElement.classList.add('e-selected');
20750
+ if (document.getElementById(parent.currentFilter + 'Canvas')) {
20751
+ document.getElementById(parent.currentFilter + 'Canvas').parentElement.parentElement.classList.add('e-selected');
20752
+ }
20688
20753
  this.enableDisableTbrBtn();
20689
20754
  toolbar.refreshOverflow();
20690
20755
  }
@@ -21473,7 +21538,7 @@ class ToolbarModule {
21473
21538
  ];
21474
21539
  for (const selector of selectors) {
21475
21540
  const element = document.querySelector(selector);
21476
- if (element.classList.contains('e-selected-btn')) {
21541
+ if (element && element.classList.contains('e-selected-btn')) {
21477
21542
  element.classList.remove('e-selected-btn');
21478
21543
  break;
21479
21544
  }