@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.
- package/.eslintrc.json +260 -0
- package/CHANGELOG.md +18 -2
- package/dist/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +118 -53
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +118 -53
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/image-editor/action/selection.js +20 -14
- package/src/image-editor/action/shape.js +1 -0
- package/src/image-editor/renderer/toolbar.js +97 -39
- package/tslint.json +111 -0
|
@@ -9385,8 +9385,10 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9385
9385
|
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
9386
9386
|
}
|
|
9387
9387
|
else if (parent.activeObj.shape === 'text') {
|
|
9388
|
-
parent.
|
|
9389
|
-
|
|
9388
|
+
if (parent.textArea.style.display === 'none') {
|
|
9389
|
+
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'text',
|
|
9390
|
+
isApplyBtn: null, isCropping: null, isZooming: null, cType: null } });
|
|
9391
|
+
}
|
|
9390
9392
|
}
|
|
9391
9393
|
else if (this.isFhdEditing) {
|
|
9392
9394
|
parent.notify('toolbar', { prop: 'refresh-toolbar', onPropertyChange: false, value: { type: 'pen',
|
|
@@ -9403,7 +9405,7 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9403
9405
|
|| (parent.activeObj.shape === 'line' || parent.activeObj.shape === 'arrow' || parent.activeObj.shape === 'path')) {
|
|
9404
9406
|
parent.updateToolbar(parent.element, parent.activeObj.shape);
|
|
9405
9407
|
}
|
|
9406
|
-
else if (parent.activeObj.shape === 'text') {
|
|
9408
|
+
else if (parent.activeObj.shape === 'text' && parent.textArea.style.display === 'none') {
|
|
9407
9409
|
parent.updateToolbar(parent.element, 'text');
|
|
9408
9410
|
}
|
|
9409
9411
|
}
|
|
@@ -9718,23 +9720,24 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
9718
9720
|
parent.activeObj = extend({}, activeObj, null, true);
|
|
9719
9721
|
parent.textArea.value = obj.keyHistory;
|
|
9720
9722
|
parent.textArea.style.display = 'block';
|
|
9721
|
-
var strokeColor = obj.strokeSettings.strokeColor.split('(')[0] === 'rgb' ?
|
|
9723
|
+
var strokeColor = obj.strokeSettings && obj.strokeSettings.strokeColor ? obj.strokeSettings.strokeColor.split('(')[0] === 'rgb' ?
|
|
9722
9724
|
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])) :
|
|
9723
|
-
obj.strokeSettings.strokeColor;
|
|
9724
|
-
if (strokeColor === '#ffffff') {
|
|
9725
|
+
obj.strokeSettings.strokeColor : null;
|
|
9726
|
+
if (strokeColor && strokeColor === '#ffffff') {
|
|
9725
9727
|
strokeColor = '#fff';
|
|
9726
9728
|
}
|
|
9727
|
-
if (this.tempActiveObj.strokeSettings.strokeColor
|
|
9729
|
+
if (this.tempActiveObj.strokeSettings && this.tempActiveObj.strokeSettings.strokeColor &&
|
|
9730
|
+
this.tempActiveObj.strokeSettings.strokeColor === '#ffffff') {
|
|
9728
9731
|
this.tempActiveObj.strokeSettings.strokeColor = '#fff';
|
|
9729
9732
|
}
|
|
9730
9733
|
if (obj.keyHistory !== this.tempActiveObj.keyHistory ||
|
|
9731
|
-
strokeColor !== this.tempActiveObj.strokeSettings.strokeColor ||
|
|
9732
|
-
obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily ||
|
|
9733
|
-
Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize) ||
|
|
9734
|
-
Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio) ||
|
|
9735
|
-
obj.textSettings.bold !== this.tempActiveObj.textSettings.bold ||
|
|
9736
|
-
obj.textSettings.italic !== this.tempActiveObj.textSettings.italic ||
|
|
9737
|
-
obj.textSettings.underline !== this.tempActiveObj.textSettings.underline) {
|
|
9734
|
+
(strokeColor && (strokeColor !== this.tempActiveObj.strokeSettings.strokeColor)) ||
|
|
9735
|
+
(obj.textSettings && obj.textSettings.fontFamily !== this.tempActiveObj.textSettings.fontFamily) ||
|
|
9736
|
+
(obj.textSettings && Math.round(obj.textSettings.fontSize) !== Math.round(this.tempActiveObj.textSettings.fontSize)) ||
|
|
9737
|
+
(obj.textSettings && Math.round(obj.textSettings.fontRatio) !== Math.round(this.tempActiveObj.textSettings.fontRatio)) ||
|
|
9738
|
+
(obj.textSettings && obj.textSettings.bold !== this.tempActiveObj.textSettings.bold) ||
|
|
9739
|
+
(obj.textSettings && obj.textSettings.italic !== this.tempActiveObj.textSettings.italic) ||
|
|
9740
|
+
(obj.textSettings && obj.textSettings.underline !== this.tempActiveObj.textSettings.underline)) {
|
|
9738
9741
|
isApply = true;
|
|
9739
9742
|
}
|
|
9740
9743
|
if (this.isInitialTextEdited && !isApply) {
|
|
@@ -10482,6 +10485,9 @@ var Selection = /** @__PURE__ @class */ (function () {
|
|
|
10482
10485
|
isInside = true;
|
|
10483
10486
|
}
|
|
10484
10487
|
}
|
|
10488
|
+
else if (parent.textArea.style.display === 'block') {
|
|
10489
|
+
isInside = true;
|
|
10490
|
+
}
|
|
10485
10491
|
if (!isInside) {
|
|
10486
10492
|
if (isNullOrUndefined(parent.activeObj.currIndex)) {
|
|
10487
10493
|
parent.activeObj.currIndex = 'shape_' + (parent.objColl.length + 1);
|
|
@@ -11412,6 +11418,7 @@ var Shape = /** @__PURE__ @class */ (function () {
|
|
|
11412
11418
|
parent.textArea.style.transform = '';
|
|
11413
11419
|
parent.notify('toolbar', { prop: 'refresh-main-toolbar', onPropertyChange: false });
|
|
11414
11420
|
}
|
|
11421
|
+
this.refreshActiveObj();
|
|
11415
11422
|
}
|
|
11416
11423
|
else {
|
|
11417
11424
|
this.applyActObj(isMouseDown);
|
|
@@ -19430,26 +19437,36 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19430
19437
|
ToolbarModule.prototype.renderAnnotationBtn = function (isContextualToolbar) {
|
|
19431
19438
|
var _this = this;
|
|
19432
19439
|
var parent = this.parent;
|
|
19440
|
+
var isCustomized = false;
|
|
19433
19441
|
var items = [];
|
|
19434
|
-
|
|
19442
|
+
var defItems = ['Ellipse', 'Arrow', 'Line', 'Rectangle', 'Pen', 'Path', 'Text'];
|
|
19443
|
+
if (parent.toolbar) {
|
|
19444
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
19445
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
19446
|
+
isCustomized = true;
|
|
19447
|
+
break;
|
|
19448
|
+
}
|
|
19449
|
+
}
|
|
19450
|
+
}
|
|
19451
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Pen') > -1)) {
|
|
19435
19452
|
items.push({ text: this.l10n.getConstant('Pen'), id: 'pen', iconCss: 'e-icons e-free-pen' });
|
|
19436
19453
|
}
|
|
19437
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
|
|
19454
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Line') > -1)) {
|
|
19438
19455
|
items.push({ text: this.l10n.getConstant('Line'), id: 'line', iconCss: 'e-icons e-line' });
|
|
19439
19456
|
}
|
|
19440
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
|
|
19457
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Rectangle') > -1)) {
|
|
19441
19458
|
items.push({ text: this.l10n.getConstant('Rectangle'), id: 'rectangle', iconCss: 'e-icons e-rectangle' });
|
|
19442
19459
|
}
|
|
19443
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
|
|
19460
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Ellipse') > -1)) {
|
|
19444
19461
|
items.push({ text: this.l10n.getConstant('Ellipse'), id: 'ellipse', iconCss: 'e-icons e-circle' });
|
|
19445
19462
|
}
|
|
19446
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
|
|
19463
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Arrow') > -1)) {
|
|
19447
19464
|
items.push({ text: this.l10n.getConstant('Arrow'), id: 'arrow', iconCss: 'e-icons e-arrow-right-up' });
|
|
19448
19465
|
}
|
|
19449
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
|
|
19466
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Path') > -1)) {
|
|
19450
19467
|
items.push({ text: this.l10n.getConstant('Path'), id: 'path', iconCss: 'e-icons e-critical-path' });
|
|
19451
19468
|
}
|
|
19452
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
|
|
19469
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Text') > -1)) {
|
|
19453
19470
|
items.push({ text: this.l10n.getConstant('Text'), id: 'text', iconCss: 'e-icons e-add-text' });
|
|
19454
19471
|
}
|
|
19455
19472
|
var obj = { freehandDrawSelectedId: null };
|
|
@@ -19554,16 +19571,26 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19554
19571
|
var _this = this;
|
|
19555
19572
|
var parent = this.parent;
|
|
19556
19573
|
var items = [];
|
|
19557
|
-
|
|
19574
|
+
var isCustomized = false;
|
|
19575
|
+
var defItems = ['CustomSelection', 'CircleSelection', 'SquareSelection', 'RatioSelection'];
|
|
19576
|
+
if (parent.toolbar) {
|
|
19577
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
19578
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
19579
|
+
isCustomized = true;
|
|
19580
|
+
break;
|
|
19581
|
+
}
|
|
19582
|
+
}
|
|
19583
|
+
}
|
|
19584
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CustomSelection') > -1)) {
|
|
19558
19585
|
items.push({ text: this.l10n.getConstant('Custom'), id: 'custom', iconCss: 'e-icons e-custom' });
|
|
19559
19586
|
}
|
|
19560
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
|
|
19587
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('CircleSelection') > -1)) {
|
|
19561
19588
|
items.push({ text: this.l10n.getConstant('Circle'), id: 'circle', iconCss: 'e-icons e-circle' });
|
|
19562
19589
|
}
|
|
19563
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
|
|
19590
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('SquareSelection') > -1)) {
|
|
19564
19591
|
items.push({ text: this.l10n.getConstant('Square'), id: 'square', iconCss: 'e-icons e-square' });
|
|
19565
19592
|
}
|
|
19566
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
|
|
19593
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('RatioSelection') > -1)) {
|
|
19567
19594
|
items.push({ text: '3:2', id: '3:2', iconCss: 'e-icons e-custom-a' });
|
|
19568
19595
|
items.push({ text: '4:3', id: '4:3', iconCss: 'e-icons e-custom-b' });
|
|
19569
19596
|
items.push({ text: '5:4', id: '5:4', iconCss: 'e-icons e-custom-c' });
|
|
@@ -19581,8 +19608,8 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19581
19608
|
shape = parent.currSelectionPoint.shape;
|
|
19582
19609
|
}
|
|
19583
19610
|
else {
|
|
19584
|
-
iconCss =
|
|
19585
|
-
shape =
|
|
19611
|
+
iconCss = items[0].iconCss;
|
|
19612
|
+
shape = items[0].id;
|
|
19586
19613
|
}
|
|
19587
19614
|
var drpDownBtn = new DropDownButton({
|
|
19588
19615
|
open: function (args) {
|
|
@@ -19664,15 +19691,29 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19664
19691
|
template: '<button id="' + parent.element.id + '_cropBtn"></button>'
|
|
19665
19692
|
});
|
|
19666
19693
|
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19694
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
19695
|
+
parent.toolbar.indexOf('RotateLeft') > -1))) {
|
|
19696
|
+
toolbarItems.push({ id: parent.element.id + '_rotateLeft', prefixIcon: 'e-icons e-anti-clock-wise',
|
|
19697
|
+
tooltipText: this.l10n.getConstant('RotateLeft'), align: 'Center' });
|
|
19698
|
+
}
|
|
19699
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
19700
|
+
parent.toolbar.indexOf('RotateRight') > -1))) {
|
|
19701
|
+
toolbarItems.push({ id: parent.element.id + '_rotateRight', prefixIcon: 'e-icons e-clock-wise',
|
|
19702
|
+
tooltipText: this.l10n.getConstant('RotateRight'), align: 'Center' });
|
|
19703
|
+
}
|
|
19704
|
+
if (toolbarItems.length > 2) {
|
|
19705
|
+
toolbarItems.push({ align: 'Center', type: 'Separator' });
|
|
19706
|
+
}
|
|
19707
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
19708
|
+
parent.toolbar.indexOf('HorizontalFlip') > -1))) {
|
|
19709
|
+
toolbarItems.push({ id: parent.element.id + '_horizontalFlip', prefixIcon: 'e-icons e-horizontal-flip',
|
|
19710
|
+
tooltipText: this.l10n.getConstant('HorizontalFlip'), align: 'Center' });
|
|
19711
|
+
}
|
|
19712
|
+
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && (parent.toolbar.indexOf('Transform') > -1 ||
|
|
19713
|
+
parent.toolbar.indexOf('VerticalFlip') > -1))) {
|
|
19714
|
+
toolbarItems.push({ id: parent.element.id + '_verticalFlip', prefixIcon: 'e-icons e-vertical-flip',
|
|
19715
|
+
tooltipText: this.l10n.getConstant('VerticalFlip'), align: 'Center' });
|
|
19716
|
+
}
|
|
19676
19717
|
if (!Browser.isDevice) {
|
|
19677
19718
|
toolbarItems.push({ id: parent.element.id + '_ok', prefixIcon: 'e-icons e-check', cssClass: 'top-icon e-tick',
|
|
19678
19719
|
tooltipText: this.l10n.getConstant('OK'), align: 'Right' });
|
|
@@ -19778,7 +19819,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
19778
19819
|
toolbar.refreshOverflow();
|
|
19779
19820
|
}
|
|
19780
19821
|
}
|
|
19781
|
-
parent.
|
|
19822
|
+
if (document.getElementById(parent.element.id + '_cropBtn')) {
|
|
19823
|
+
parent.select(document.getElementById(parent.element.id + '_cropBtn').textContent.toLowerCase());
|
|
19824
|
+
}
|
|
19782
19825
|
}
|
|
19783
19826
|
});
|
|
19784
19827
|
if (Browser.isDevice) {
|
|
@@ -20412,31 +20455,41 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20412
20455
|
ToolbarModule.prototype.getAdjustmentToolbarItem = function () {
|
|
20413
20456
|
var toolbarItems = [];
|
|
20414
20457
|
var parent = this.parent;
|
|
20415
|
-
|
|
20458
|
+
var isCustomized = false;
|
|
20459
|
+
var defItems = ['Brightness', 'Contrast', 'Hue', 'Saturation', 'Exposure', 'Opacity', 'Blur'];
|
|
20460
|
+
if (parent.toolbar) {
|
|
20461
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
20462
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
20463
|
+
isCustomized = true;
|
|
20464
|
+
break;
|
|
20465
|
+
}
|
|
20466
|
+
}
|
|
20467
|
+
}
|
|
20468
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Brightness') > -1)) {
|
|
20416
20469
|
toolbarItems.push({ id: parent.element.id + '_brightness', prefixIcon: 'e-icons e-brightness', cssClass: 'top-icon e-brightness',
|
|
20417
20470
|
tooltipText: this.l10n.getConstant('Brightness'), align: 'Center' });
|
|
20418
20471
|
}
|
|
20419
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
|
|
20472
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Contrast') > -1)) {
|
|
20420
20473
|
toolbarItems.push({ id: parent.element.id + '_contrast', prefixIcon: 'e-icons e-contrast', cssClass: 'top-icon e-contrast',
|
|
20421
20474
|
tooltipText: this.l10n.getConstant('Contrast'), align: 'Center' });
|
|
20422
20475
|
}
|
|
20423
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
|
|
20476
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Hue') > -1)) {
|
|
20424
20477
|
toolbarItems.push({ id: parent.element.id + '_hue', prefixIcon: 'e-icons e-fade', cssClass: 'top-icon e-fade',
|
|
20425
20478
|
tooltipText: this.l10n.getConstant('Hue'), align: 'Center' });
|
|
20426
20479
|
}
|
|
20427
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
|
|
20480
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Saturation') > -1)) {
|
|
20428
20481
|
toolbarItems.push({ id: parent.element.id + '_saturation', prefixIcon: 'e-icons e-saturation', cssClass: 'top-icon e-saturation',
|
|
20429
20482
|
tooltipText: this.l10n.getConstant('Saturation'), align: 'Center' });
|
|
20430
20483
|
}
|
|
20431
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
|
|
20484
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Exposure') > -1)) {
|
|
20432
20485
|
toolbarItems.push({ id: parent.element.id + '_exposure', prefixIcon: 'e-icons e-grain', cssClass: 'top-icon e-grain',
|
|
20433
20486
|
tooltipText: this.l10n.getConstant('Exposure'), align: 'Center' });
|
|
20434
20487
|
}
|
|
20435
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
|
|
20488
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Opacity') > -1)) {
|
|
20436
20489
|
toolbarItems.push({ id: parent.element.id + '_opacity', prefixIcon: 'e-icons e-opacity', cssClass: 'top-icon e-opacity',
|
|
20437
20490
|
tooltipText: this.l10n.getConstant('Opacity'), align: 'Center' });
|
|
20438
20491
|
}
|
|
20439
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
|
|
20492
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Blur') > -1)) {
|
|
20440
20493
|
toolbarItems.push({ id: parent.element.id + '_blur', prefixIcon: 'e-icons e-tint', cssClass: 'top-icon e-tint',
|
|
20441
20494
|
tooltipText: this.l10n.getConstant('Blur'), align: 'Center' });
|
|
20442
20495
|
}
|
|
@@ -20455,37 +20508,47 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20455
20508
|
ToolbarModule.prototype.getFilterToolbarItem = function () {
|
|
20456
20509
|
var toolbarItems = [];
|
|
20457
20510
|
var parent = this.parent;
|
|
20458
|
-
|
|
20511
|
+
var isCustomized = false;
|
|
20512
|
+
var defItems = ['Default', 'Chrome', 'Cold', 'Warm', 'Grayscale', 'Sepia', 'Invert'];
|
|
20513
|
+
if (parent.toolbar) {
|
|
20514
|
+
for (var i = 0; i < defItems.length; i++) {
|
|
20515
|
+
if (parent.toolbar.indexOf(defItems[i]) !== -1) {
|
|
20516
|
+
isCustomized = true;
|
|
20517
|
+
break;
|
|
20518
|
+
}
|
|
20519
|
+
}
|
|
20520
|
+
}
|
|
20521
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Default') > -1)) {
|
|
20459
20522
|
toolbarItems.push({ id: parent.element.id + '_default', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20460
20523
|
tooltipText: this.l10n.getConstant('Default'), align: 'Center',
|
|
20461
20524
|
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>' });
|
|
20462
20525
|
}
|
|
20463
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
20526
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Chrome') > -1)) {
|
|
20464
20527
|
toolbarItems.push({ id: parent.element.id + '_chrome', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20465
20528
|
tooltipText: this.l10n.getConstant('Chrome'), align: 'Center',
|
|
20466
20529
|
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>' });
|
|
20467
20530
|
}
|
|
20468
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
|
|
20531
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Cold') > -1)) {
|
|
20469
20532
|
toolbarItems.push({ id: parent.element.id + '_cold', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20470
20533
|
tooltipText: this.l10n.getConstant('Cold'), align: 'Center',
|
|
20471
20534
|
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>' });
|
|
20472
20535
|
}
|
|
20473
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
|
|
20536
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Warm') > -1)) {
|
|
20474
20537
|
toolbarItems.push({ id: parent.element.id + '_warm', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20475
20538
|
tooltipText: this.l10n.getConstant('Warm'), align: 'Center',
|
|
20476
20539
|
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>' });
|
|
20477
20540
|
}
|
|
20478
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
|
|
20541
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Grayscale') > -1)) {
|
|
20479
20542
|
toolbarItems.push({ id: parent.element.id + '_grayscale', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20480
20543
|
tooltipText: this.l10n.getConstant('Grayscale'), align: 'Center',
|
|
20481
20544
|
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>' });
|
|
20482
20545
|
}
|
|
20483
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
|
|
20546
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Sepia') > -1)) {
|
|
20484
20547
|
toolbarItems.push({ id: parent.element.id + '_sepia', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20485
20548
|
tooltipText: this.l10n.getConstant('Sepia'), align: 'Center',
|
|
20486
20549
|
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>' });
|
|
20487
20550
|
}
|
|
20488
|
-
if (isNullOrUndefined(parent.toolbar) || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
|
|
20551
|
+
if (isNullOrUndefined(parent.toolbar) || !isCustomized || (parent.toolbar && parent.toolbar.indexOf('Invert') > -1)) {
|
|
20489
20552
|
toolbarItems.push({ id: parent.element.id + '_invert', prefixIcon: 'e-icons e-none', cssClass: 'top-icon e-none',
|
|
20490
20553
|
tooltipText: this.l10n.getConstant('Invert'), align: 'Center',
|
|
20491
20554
|
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>' });
|
|
@@ -20759,7 +20822,9 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
20759
20822
|
if (hdrWrapper) {
|
|
20760
20823
|
hdrWrapper.style.display = 'none';
|
|
20761
20824
|
}
|
|
20762
|
-
document.getElementById(parent.currentFilter + 'Canvas')
|
|
20825
|
+
if (document.getElementById(parent.currentFilter + 'Canvas')) {
|
|
20826
|
+
document.getElementById(parent.currentFilter + 'Canvas').parentElement.parentElement.classList.add('e-selected');
|
|
20827
|
+
}
|
|
20763
20828
|
_this.enableDisableTbrBtn();
|
|
20764
20829
|
toolbar.refreshOverflow();
|
|
20765
20830
|
}
|
|
@@ -21550,7 +21615,7 @@ var ToolbarModule = /** @__PURE__ @class */ (function () {
|
|
|
21550
21615
|
for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {
|
|
21551
21616
|
var selector = selectors_1[_i];
|
|
21552
21617
|
var element = document.querySelector(selector);
|
|
21553
|
-
if (element.classList.contains('e-selected-btn')) {
|
|
21618
|
+
if (element && element.classList.contains('e-selected-btn')) {
|
|
21554
21619
|
element.classList.remove('e-selected-btn');
|
|
21555
21620
|
break;
|
|
21556
21621
|
}
|