[SSE] Fix loading color palettes in the toolbar menu.
This commit is contained in:
parent
59750ed06b
commit
b53b32e67f
|
@ -176,7 +176,7 @@ define([
|
||||||
Common.NotificationCenter.on('app:face', this.onAppShowed.bind(this));
|
Common.NotificationCenter.on('app:face', this.onAppShowed.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
onToolbarAfterRender: function(toolbar) {
|
attachUIEvents: function(toolbar) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1331,7 +1331,7 @@ define([
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
this.toolbar.createDelayedElements();
|
this.toolbar.createDelayedElements();
|
||||||
this.onToolbarAfterRender(this.toolbar);
|
this.attachUIEvents(this.toolbar);
|
||||||
|
|
||||||
if ( !this.appConfig.isEditDiagram && !this.appConfig.isEditMailMerge ) {
|
if ( !this.appConfig.isEditDiagram && !this.appConfig.isEditMailMerge ) {
|
||||||
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.onApiSheetChanged, this));
|
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.onApiSheetChanged, this));
|
||||||
|
|
|
@ -421,14 +421,6 @@ define([
|
||||||
{ template: _.template('<a id="id-toolbar-menu-new-fontcolor" style="padding-left:12px;">' + me.textNewColor + '</a>') }
|
{ template: _.template('<a id="id-toolbar-menu-new-fontcolor" style="padding-left:12px;">' + me.textNewColor + '</a>') }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}).on('render:after', function(btn) {
|
|
||||||
var colorVal = $('<div class="btn-color-value-line"></div>');
|
|
||||||
$('button:first-child', btn.cmpEl).append(colorVal);
|
|
||||||
colorVal.css('background-color', btn.currentColor || 'transparent');
|
|
||||||
|
|
||||||
me.mnuTextColorPicker = new Common.UI.ThemeColorPalette({
|
|
||||||
el: $('#id-toolbar-menu-fontcolor')
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
me.mnuBackColorPicker = dummyCmp();
|
me.mnuBackColorPicker = dummyCmp();
|
||||||
|
@ -444,15 +436,6 @@ define([
|
||||||
{ template: _.template('<a id="id-toolbar-menu-new-paracolor" style="padding-left:12px;">' + me.textNewColor + '</a>') }
|
{ template: _.template('<a id="id-toolbar-menu-new-paracolor" style="padding-left:12px;">' + me.textNewColor + '</a>') }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}).on('render:after', function(btn) {
|
|
||||||
var colorVal = $('<div class="btn-color-value-line"></div>');
|
|
||||||
$('button:first-child', btn.cmpEl).append(colorVal);
|
|
||||||
colorVal.css('background-color', btn.currentColor || 'transparent');
|
|
||||||
|
|
||||||
me.mnuBackColorPicker = new Common.UI.ThemeColorPalette({
|
|
||||||
el: $('#id-toolbar-menu-paracolor'),
|
|
||||||
transparent: true
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
me.btnBorders = new Common.UI.Button({
|
me.btnBorders = new Common.UI.Button({
|
||||||
|
@ -1244,6 +1227,8 @@ define([
|
||||||
if (cmp && _.isFunction(cmp.setDisabled))
|
if (cmp && _.isFunction(cmp.setDisabled))
|
||||||
cmp.setDisabled(true);
|
cmp.setDisabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.on('render:after', _.bind(this.onToolbarAfterRender, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function (mode) {
|
render: function (mode) {
|
||||||
|
@ -1684,6 +1669,29 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onToolbarAfterRender: function(toolbar) {
|
||||||
|
// DataView and pickers
|
||||||
|
//
|
||||||
|
if (this.btnTextColor.cmpEl) {
|
||||||
|
var colorVal = $('<div class="btn-color-value-line"></div>');
|
||||||
|
$('button:first-child', this.btnTextColor.cmpEl).append(colorVal);
|
||||||
|
colorVal.css('background-color', this.btnTextColor.currentColor || 'transparent');
|
||||||
|
this.mnuTextColorPicker = new Common.UI.ThemeColorPalette({
|
||||||
|
el: $('#id-toolbar-menu-fontcolor')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (this.btnBackColor.cmpEl) {
|
||||||
|
var colorVal = $('<div class="btn-color-value-line"></div>');
|
||||||
|
$('button:first-child', this.btnBackColor.cmpEl).append(colorVal);
|
||||||
|
colorVal.css('background-color', this.btnBackColor.currentColor || 'transparent');
|
||||||
|
|
||||||
|
this.mnuBackColorPicker = new Common.UI.ThemeColorPalette({
|
||||||
|
el: $('#id-toolbar-menu-paracolor'),
|
||||||
|
transparent: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue