Refactoring textures loading
This commit is contained in:
parent
c022b065a0
commit
2bce4a8971
|
@ -78,6 +78,7 @@ define([
|
||||||
this.imgprops = null;
|
this.imgprops = null;
|
||||||
this._sendUndoPoint = true;
|
this._sendUndoPoint = true;
|
||||||
this._sliderChanged = false;
|
this._sliderChanged = false;
|
||||||
|
this._texturearray = null;
|
||||||
|
|
||||||
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
|
|
||||||
|
@ -1516,6 +1517,7 @@ define([
|
||||||
this.PatternFillType = this.patternViewData[0].type;
|
this.PatternFillType = this.patternViewData[0].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.onInitStandartTextures();
|
||||||
this.onApiAutoShapes();
|
this.onApiAutoShapes();
|
||||||
this.UpdateThemeColors();
|
this.UpdateThemeColors();
|
||||||
},
|
},
|
||||||
|
@ -1523,29 +1525,9 @@ define([
|
||||||
onInitStandartTextures: function(texture) {
|
onInitStandartTextures: function(texture) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (texture && texture.length>0){
|
if (texture && texture.length>0){
|
||||||
if (!this.btnTexture) {
|
me._texturearray = [];
|
||||||
this.btnTexture = new Common.UI.ComboBox({
|
|
||||||
el: $('#shape-combo-fill-texture'),
|
|
||||||
template: _.template([
|
|
||||||
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
|
||||||
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
|
||||||
'<div style="display: table-cell;"></div>',
|
|
||||||
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
|
||||||
'</div>'
|
|
||||||
].join(''))
|
|
||||||
});
|
|
||||||
this.textureMenu = new Common.UI.Menu({
|
|
||||||
items: [
|
|
||||||
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
this.textureMenu.render($('#shape-combo-fill-texture'));
|
|
||||||
this.fillControls.push(this.btnTexture);
|
|
||||||
}
|
|
||||||
|
|
||||||
var texturearray = [];
|
|
||||||
_.each(texture, function(item){
|
_.each(texture, function(item){
|
||||||
texturearray.push({
|
me._texturearray.push({
|
||||||
imageUrl: item.get_image(),
|
imageUrl: item.get_image(),
|
||||||
name : me.textureNames[item.get_id()],
|
name : me.textureNames[item.get_id()],
|
||||||
type : item.get_id(),
|
type : item.get_id(),
|
||||||
|
@ -1553,15 +1535,41 @@ define([
|
||||||
selected: false
|
selected: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
}
|
||||||
el: $('#id-shape-menu-texture'),
|
|
||||||
restoreHeight: 174,
|
if (!me._texturearray || me._texturearray.length<1) return;
|
||||||
parentMenu: me.textureMenu,
|
if (!this._initSettings && !this.btnTexture) {
|
||||||
showLast: false,
|
this.btnTexture = new Common.UI.ComboBox({
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
el: $('#shape-combo-fill-texture'),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
template: _.template([
|
||||||
|
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
||||||
|
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
||||||
|
'<div style="display: table-cell;"></div>',
|
||||||
|
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
this.textureMenu = new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.textureMenu.render($('#shape-combo-fill-texture'));
|
||||||
|
this.fillControls.push(this.btnTexture);
|
||||||
|
|
||||||
|
var onShowBefore = function(menu) {
|
||||||
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
|
el: $('#id-shape-menu-texture'),
|
||||||
|
restoreHeight: 174,
|
||||||
|
parentMenu: menu,
|
||||||
|
showLast: false,
|
||||||
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
|
});
|
||||||
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
|
menu.off('show:before', onShowBefore);
|
||||||
|
};
|
||||||
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ define([
|
||||||
this._noApply = true;
|
this._noApply = true;
|
||||||
this._sendUndoPoint = true;
|
this._sendUndoPoint = true;
|
||||||
this._sliderChanged = false;
|
this._sliderChanged = false;
|
||||||
|
this._texturearray = null;
|
||||||
|
|
||||||
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
|
|
||||||
|
@ -1391,6 +1392,7 @@ define([
|
||||||
this.PatternFillType = this.patternViewData[0].type;
|
this.PatternFillType = this.patternViewData[0].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.onInitStandartTextures();
|
||||||
this.onApiAutoShapes();
|
this.onApiAutoShapes();
|
||||||
this.UpdateThemeColors();
|
this.UpdateThemeColors();
|
||||||
},
|
},
|
||||||
|
@ -1398,28 +1400,9 @@ define([
|
||||||
onInitStandartTextures: function(texture) {
|
onInitStandartTextures: function(texture) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (texture && texture.length>0){
|
if (texture && texture.length>0){
|
||||||
if (!this.btnTexture) {
|
me._texturearray = [];
|
||||||
this.btnTexture = new Common.UI.ComboBox({
|
|
||||||
el: $('#shape-combo-fill-texture'),
|
|
||||||
template: _.template([
|
|
||||||
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
|
||||||
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
|
||||||
'<div style="display: table-cell;"></div>',
|
|
||||||
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
|
||||||
'</div>'
|
|
||||||
].join(''))
|
|
||||||
});
|
|
||||||
this.textureMenu = new Common.UI.Menu({
|
|
||||||
items: [
|
|
||||||
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
this.textureMenu.render($('#shape-combo-fill-texture'));
|
|
||||||
this.fillControls.push(this.btnTexture);
|
|
||||||
}
|
|
||||||
var texturearray = [];
|
|
||||||
_.each(texture, function(item){
|
_.each(texture, function(item){
|
||||||
texturearray.push({
|
me._texturearray.push({
|
||||||
imageUrl: item.get_image(),
|
imageUrl: item.get_image(),
|
||||||
name : me.textureNames[item.get_id()],
|
name : me.textureNames[item.get_id()],
|
||||||
type : item.get_id(),
|
type : item.get_id(),
|
||||||
|
@ -1427,15 +1410,41 @@ define([
|
||||||
selected: false
|
selected: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
}
|
||||||
el: $('#id-shape-menu-texture'),
|
|
||||||
restoreHeight: 174,
|
if (!me._texturearray || me._texturearray.length<1) return;
|
||||||
parentMenu: me.textureMenu,
|
if (!this._initSettings && !this.btnTexture) {
|
||||||
showLast: false,
|
this.btnTexture = new Common.UI.ComboBox({
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
el: $('#shape-combo-fill-texture'),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
template: _.template([
|
||||||
|
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
||||||
|
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
||||||
|
'<div style="display: table-cell;"></div>',
|
||||||
|
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
this.textureMenu = new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.textureMenu.render($('#shape-combo-fill-texture'));
|
||||||
|
this.fillControls.push(this.btnTexture);
|
||||||
|
|
||||||
|
var onShowBefore = function(menu) {
|
||||||
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
|
el: $('#id-shape-menu-texture'),
|
||||||
|
restoreHeight: 174,
|
||||||
|
parentMenu: menu,
|
||||||
|
showLast: false,
|
||||||
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
|
});
|
||||||
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
|
menu.off('show:before', onShowBefore);
|
||||||
|
};
|
||||||
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ define([
|
||||||
this._noApply = true;
|
this._noApply = true;
|
||||||
this._sendUndoPoint = true;
|
this._sendUndoPoint = true;
|
||||||
this._sliderChanged = false;
|
this._sliderChanged = false;
|
||||||
|
this._texturearray = null;
|
||||||
|
|
||||||
this.FillItems = [];
|
this.FillItems = [];
|
||||||
|
|
||||||
|
@ -842,34 +843,16 @@ define([
|
||||||
this.PatternFillType = this.patternViewData[0].type;
|
this.PatternFillType = this.patternViewData[0].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.onInitStandartTextures();
|
||||||
this.UpdateThemeColors();
|
this.UpdateThemeColors();
|
||||||
},
|
},
|
||||||
|
|
||||||
onInitStandartTextures: function(texture) {
|
onInitStandartTextures: function(texture) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (texture && texture.length>0){
|
if (texture && texture.length>0){
|
||||||
if (!this.btnTexture) {
|
me._texturearray = [];
|
||||||
this.btnTexture = new Common.UI.ComboBox({
|
|
||||||
el: $('#slide-combo-fill-texture'),
|
|
||||||
template: _.template([
|
|
||||||
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
|
||||||
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
|
||||||
'<div style="display: table-cell;"></div>',
|
|
||||||
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
|
||||||
'</div>'
|
|
||||||
].join(''))
|
|
||||||
});
|
|
||||||
this.textureMenu = new Common.UI.Menu({
|
|
||||||
items: [
|
|
||||||
{ template: _.template('<div id="id-slide-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
this.textureMenu.render($('#slide-combo-fill-texture'));
|
|
||||||
this.FillItems.push(this.btnTexture);
|
|
||||||
}
|
|
||||||
var texturearray = [];
|
|
||||||
_.each(texture, function(item){
|
_.each(texture, function(item){
|
||||||
texturearray.push({
|
me._texturearray.push({
|
||||||
imageUrl: item.get_image(),
|
imageUrl: item.get_image(),
|
||||||
name : me.textureNames[item.get_id()],
|
name : me.textureNames[item.get_id()],
|
||||||
type : item.get_id(),
|
type : item.get_id(),
|
||||||
|
@ -877,15 +860,41 @@ define([
|
||||||
selected: false
|
selected: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
}
|
||||||
el: $('#id-slide-menu-texture'),
|
|
||||||
restoreHeight: 174,
|
if (!me._texturearray || me._texturearray.length<1) return;
|
||||||
parentMenu: me.textureMenu,
|
if (!this._initSettings && !this.btnTexture) {
|
||||||
showLast: false,
|
this.btnTexture = new Common.UI.ComboBox({
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
el: $('#slide-combo-fill-texture'),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
template: _.template([
|
||||||
|
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
||||||
|
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
||||||
|
'<div style="display: table-cell;"></div>',
|
||||||
|
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
this.textureMenu = new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ template: _.template('<div id="id-slide-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.textureMenu.render($('#slide-combo-fill-texture'));
|
||||||
|
this.FillItems.push(this.btnTexture);
|
||||||
|
|
||||||
|
var onShowBefore = function(menu) {
|
||||||
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
|
el: $('#id-slide-menu-texture'),
|
||||||
|
restoreHeight: 174,
|
||||||
|
parentMenu: menu,
|
||||||
|
showLast: false,
|
||||||
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
|
});
|
||||||
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
|
menu.off('show:before', onShowBefore);
|
||||||
|
};
|
||||||
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ define([
|
||||||
this.shapeprops = null;
|
this.shapeprops = null;
|
||||||
this._sendUndoPoint = true;
|
this._sendUndoPoint = true;
|
||||||
this._sliderChanged = false;
|
this._sliderChanged = false;
|
||||||
|
this._texturearray = null;
|
||||||
|
|
||||||
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
|
|
||||||
|
@ -1328,6 +1329,7 @@ define([
|
||||||
this.PatternFillType = this.patternViewData[0].type;
|
this.PatternFillType = this.patternViewData[0].type;
|
||||||
}
|
}
|
||||||
this.UpdateThemeColors();
|
this.UpdateThemeColors();
|
||||||
|
this.onInitStandartTextures();
|
||||||
this.fillTextArt();
|
this.fillTextArt();
|
||||||
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
|
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
|
||||||
},
|
},
|
||||||
|
@ -1335,43 +1337,51 @@ define([
|
||||||
onInitStandartTextures: function(texture) {
|
onInitStandartTextures: function(texture) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (texture && texture.length>0){
|
if (texture && texture.length>0){
|
||||||
if (!this.btnTexture) {
|
me._texturearray = [];
|
||||||
this.btnTexture = new Common.UI.ComboBox({
|
|
||||||
el: $('#textart-combo-fill-texture'),
|
|
||||||
template: _.template([
|
|
||||||
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
|
||||||
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
|
||||||
'<div style="display: table-cell;"></div>',
|
|
||||||
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
|
||||||
'</div>'
|
|
||||||
].join(''))
|
|
||||||
});
|
|
||||||
this.textureMenu = new Common.UI.Menu({
|
|
||||||
items: [
|
|
||||||
{ template: _.template('<div id="id-textart-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
this.textureMenu.render($('#textart-combo-fill-texture'));
|
|
||||||
this.lockedControls.push(this.btnTexture);
|
|
||||||
}
|
|
||||||
var texturearray = [];
|
|
||||||
_.each(texture, function(item){
|
_.each(texture, function(item){
|
||||||
texturearray.push({
|
me._texturearray.push({
|
||||||
imageUrl: item.get_image(),
|
imageUrl: item.get_image(),
|
||||||
name : me.textureNames[item.get_id()],
|
name : me.textureNames[item.get_id()],
|
||||||
type : item.get_id(),
|
type : item.get_id(),
|
||||||
|
// allowSelected : false,
|
||||||
selected: false
|
selected: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
}
|
||||||
el: $('#id-textart-menu-texture'),
|
|
||||||
restoreHeight: 174,
|
if (!me._texturearray || me._texturearray.length<1) return;
|
||||||
parentMenu: me.textureMenu,
|
if (!this._initSettings && !this.btnTexture) {
|
||||||
showLast: false,
|
this.btnTexture = new Common.UI.ComboBox({
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
el: $('#textart-combo-fill-texture'),
|
||||||
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
template: _.template([
|
||||||
|
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
||||||
|
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
||||||
|
'<div style="display: table-cell;"></div>',
|
||||||
|
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
this.textureMenu = new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ template: _.template('<div id="id-textart-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.textureMenu.render($('#textart-combo-fill-texture'));
|
||||||
|
this.lockedControls.push(this.btnTexture);
|
||||||
|
|
||||||
|
var onShowBefore = function(menu) {
|
||||||
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
|
el: $('#id-textart-menu-texture'),
|
||||||
|
restoreHeight: 174,
|
||||||
|
parentMenu: menu,
|
||||||
|
showLast: false,
|
||||||
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
|
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
|
});
|
||||||
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
|
menu.off('show:before', onShowBefore);
|
||||||
|
};
|
||||||
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ define([
|
||||||
this.imgprops = null;
|
this.imgprops = null;
|
||||||
this._sendUndoPoint = true;
|
this._sendUndoPoint = true;
|
||||||
this._sliderChanged = false;
|
this._sliderChanged = false;
|
||||||
|
this._texturearray = null;
|
||||||
|
|
||||||
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
|
|
||||||
|
@ -1415,6 +1416,7 @@ define([
|
||||||
this.PatternFillType = this.patternViewData[0].type;
|
this.PatternFillType = this.patternViewData[0].type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.onInitStandartTextures();
|
||||||
this.onApiAutoShapes();
|
this.onApiAutoShapes();
|
||||||
this.UpdateThemeColors();
|
this.UpdateThemeColors();
|
||||||
},
|
},
|
||||||
|
@ -1422,28 +1424,9 @@ define([
|
||||||
onInitStandartTextures: function(texture) {
|
onInitStandartTextures: function(texture) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (texture && texture.length>0){
|
if (texture && texture.length>0){
|
||||||
if (!this.btnTexture) {
|
me._texturearray = [];
|
||||||
this.btnTexture = new Common.UI.ComboBox({
|
|
||||||
el: $('#shape-combo-fill-texture'),
|
|
||||||
template: _.template([
|
|
||||||
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
|
||||||
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
|
||||||
'<div style="display: table-cell;"></div>',
|
|
||||||
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
|
||||||
'</div>'
|
|
||||||
].join(''))
|
|
||||||
});
|
|
||||||
this.textureMenu = new Common.UI.Menu({
|
|
||||||
items: [
|
|
||||||
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
this.textureMenu.render($('#shape-combo-fill-texture'));
|
|
||||||
this.fillControls.push(this.btnTexture);
|
|
||||||
}
|
|
||||||
var texturearray = [];
|
|
||||||
_.each(texture, function(item){
|
_.each(texture, function(item){
|
||||||
texturearray.push({
|
me._texturearray.push({
|
||||||
imageUrl: item.asc_getImage(),
|
imageUrl: item.asc_getImage(),
|
||||||
name : me.textureNames[item.asc_getId()],
|
name : me.textureNames[item.asc_getId()],
|
||||||
type : item.asc_getId(),
|
type : item.asc_getId(),
|
||||||
|
@ -1451,15 +1434,41 @@ define([
|
||||||
selected: false
|
selected: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
}
|
||||||
el: $('#id-shape-menu-texture'),
|
|
||||||
restoreHeight: 174,
|
if (!me._texturearray || me._texturearray.length<1) return;
|
||||||
parentMenu: me.textureMenu,
|
if (!this._initSettings && !this.btnTexture) {
|
||||||
showLast: false,
|
this.btnTexture = new Common.UI.ComboBox({
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
el: $('#shape-combo-fill-texture'),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
template: _.template([
|
||||||
|
'<div class="input-group combobox combo-dataview-menu input-group-nr dropdown-toggle" tabindex="0" data-toggle="dropdown">',
|
||||||
|
'<div class="form-control text" style="width: 90px;">' + this.textSelectTexture + '</div>',
|
||||||
|
'<div style="display: table-cell;"></div>',
|
||||||
|
'<button type="button" class="btn btn-default"><span class="caret img-commonctrl"></span></button>',
|
||||||
|
'</div>'
|
||||||
|
].join(''))
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
this.textureMenu = new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{ template: _.template('<div id="id-shape-menu-texture" style="width: 233px; margin: 0 5px;"></div>') }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.textureMenu.render($('#shape-combo-fill-texture'));
|
||||||
|
this.fillControls.push(this.btnTexture);
|
||||||
|
|
||||||
|
var onShowBefore = function(menu) {
|
||||||
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
|
el: $('#id-shape-menu-texture'),
|
||||||
|
restoreHeight: 174,
|
||||||
|
parentMenu: menu,
|
||||||
|
showLast: false,
|
||||||
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
|
});
|
||||||
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
|
menu.off('show:before', onShowBefore);
|
||||||
|
};
|
||||||
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ define([
|
||||||
this.shapeprops = null;
|
this.shapeprops = null;
|
||||||
this._sendUndoPoint = true;
|
this._sendUndoPoint = true;
|
||||||
this._sliderChanged = false;
|
this._sliderChanged = false;
|
||||||
|
this._texturearray = null;
|
||||||
|
|
||||||
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
|
||||||
|
|
||||||
|
@ -1333,6 +1334,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.UpdateThemeColors();
|
this.UpdateThemeColors();
|
||||||
|
this.onInitStandartTextures();
|
||||||
this.fillTextArt();
|
this.fillTextArt();
|
||||||
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
|
this.fillTransform(this.api.asc_getPropertyEditorTextArts());
|
||||||
},
|
},
|
||||||
|
@ -1340,6 +1342,20 @@ define([
|
||||||
onInitStandartTextures: function(texture) {
|
onInitStandartTextures: function(texture) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (texture && texture.length>0){
|
if (texture && texture.length>0){
|
||||||
|
me._texturearray = [];
|
||||||
|
_.each(texture, function(item){
|
||||||
|
me._texturearray.push({
|
||||||
|
imageUrl: item.get_image(),
|
||||||
|
name : me.textureNames[item.get_id()],
|
||||||
|
type : item.get_id(),
|
||||||
|
// allowSelected : false,
|
||||||
|
selected: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!me._texturearray || me._texturearray.length<1) return;
|
||||||
|
if (!this._initSettings && !this.btnTexture) {
|
||||||
this.btnTexture = new Common.UI.ComboBox({
|
this.btnTexture = new Common.UI.ComboBox({
|
||||||
el: $('#textart-combo-fill-texture'),
|
el: $('#textart-combo-fill-texture'),
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -1358,24 +1374,19 @@ define([
|
||||||
this.textureMenu.render($('#textart-combo-fill-texture'));
|
this.textureMenu.render($('#textart-combo-fill-texture'));
|
||||||
this.lockedControls.push(this.btnTexture);
|
this.lockedControls.push(this.btnTexture);
|
||||||
|
|
||||||
var texturearray = [];
|
var onShowBefore = function(menu) {
|
||||||
_.each(texture, function(item){
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
texturearray.push({
|
el: $('#id-textart-menu-texture'),
|
||||||
imageUrl: item.get_image(),
|
restoreHeight: 174,
|
||||||
name : me.textureNames[item.get_id()],
|
parentMenu: menu,
|
||||||
type : item.get_id(),
|
showLast: false,
|
||||||
selected: false
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
|
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
});
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
menu.off('show:before', onShowBefore);
|
||||||
el: $('#id-textart-menu-texture'),
|
};
|
||||||
restoreHeight: 174,
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
parentMenu: me.textureMenu,
|
|
||||||
showLast: false,
|
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
|
||||||
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
|
||||||
});
|
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue