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,7 +1525,20 @@ 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 = [];
|
||||||
|
_.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: $('#shape-combo-fill-texture'),
|
el: $('#shape-combo-fill-texture'),
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -1541,27 +1556,20 @@ define([
|
||||||
});
|
});
|
||||||
this.textureMenu.render($('#shape-combo-fill-texture'));
|
this.textureMenu.render($('#shape-combo-fill-texture'));
|
||||||
this.fillControls.push(this.btnTexture);
|
this.fillControls.push(this.btnTexture);
|
||||||
}
|
|
||||||
|
|
||||||
var texturearray = [];
|
var onShowBefore = function(menu) {
|
||||||
_.each(texture, function(item){
|
|
||||||
texturearray.push({
|
|
||||||
imageUrl: item.get_image(),
|
|
||||||
name : me.textureNames[item.get_id()],
|
|
||||||
type : item.get_id(),
|
|
||||||
// allowSelected : false,
|
|
||||||
selected: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
el: $('#id-shape-menu-texture'),
|
el: $('#id-shape-menu-texture'),
|
||||||
restoreHeight: 174,
|
restoreHeight: 174,
|
||||||
parentMenu: me.textureMenu,
|
parentMenu: menu,
|
||||||
showLast: false,
|
showLast: false,
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
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,7 +1400,20 @@ 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 = [];
|
||||||
|
_.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: $('#shape-combo-fill-texture'),
|
el: $('#shape-combo-fill-texture'),
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -1416,26 +1431,20 @@ define([
|
||||||
});
|
});
|
||||||
this.textureMenu.render($('#shape-combo-fill-texture'));
|
this.textureMenu.render($('#shape-combo-fill-texture'));
|
||||||
this.fillControls.push(this.btnTexture);
|
this.fillControls.push(this.btnTexture);
|
||||||
}
|
|
||||||
var texturearray = [];
|
var onShowBefore = function(menu) {
|
||||||
_.each(texture, function(item){
|
|
||||||
texturearray.push({
|
|
||||||
imageUrl: item.get_image(),
|
|
||||||
name : me.textureNames[item.get_id()],
|
|
||||||
type : item.get_id(),
|
|
||||||
// allowSelected : false,
|
|
||||||
selected: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
el: $('#id-shape-menu-texture'),
|
el: $('#id-shape-menu-texture'),
|
||||||
restoreHeight: 174,
|
restoreHeight: 174,
|
||||||
parentMenu: me.textureMenu,
|
parentMenu: menu,
|
||||||
showLast: false,
|
showLast: false,
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
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,13 +843,27 @@ 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 = [];
|
||||||
|
_.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: $('#slide-combo-fill-texture'),
|
el: $('#slide-combo-fill-texture'),
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -866,26 +881,20 @@ define([
|
||||||
});
|
});
|
||||||
this.textureMenu.render($('#slide-combo-fill-texture'));
|
this.textureMenu.render($('#slide-combo-fill-texture'));
|
||||||
this.FillItems.push(this.btnTexture);
|
this.FillItems.push(this.btnTexture);
|
||||||
}
|
|
||||||
var texturearray = [];
|
var onShowBefore = function(menu) {
|
||||||
_.each(texture, function(item){
|
|
||||||
texturearray.push({
|
|
||||||
imageUrl: item.get_image(),
|
|
||||||
name : me.textureNames[item.get_id()],
|
|
||||||
type : item.get_id(),
|
|
||||||
// allowSelected : false,
|
|
||||||
selected: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
el: $('#id-slide-menu-texture'),
|
el: $('#id-slide-menu-texture'),
|
||||||
restoreHeight: 174,
|
restoreHeight: 174,
|
||||||
parentMenu: me.textureMenu,
|
parentMenu: menu,
|
||||||
showLast: false,
|
showLast: false,
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
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,7 +1337,20 @@ 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 = [];
|
||||||
|
_.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([
|
||||||
|
@ -1353,25 +1368,20 @@ 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){
|
|
||||||
texturearray.push({
|
|
||||||
imageUrl: item.get_image(),
|
|
||||||
name : me.textureNames[item.get_id()],
|
|
||||||
type : item.get_id(),
|
|
||||||
selected: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
el: $('#id-textart-menu-texture'),
|
el: $('#id-textart-menu-texture'),
|
||||||
restoreHeight: 174,
|
restoreHeight: 174,
|
||||||
parentMenu: me.textureMenu,
|
parentMenu: menu,
|
||||||
showLast: false,
|
showLast: false,
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
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,7 +1424,20 @@ 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 = [];
|
||||||
|
_.each(texture, function(item){
|
||||||
|
me._texturearray.push({
|
||||||
|
imageUrl: item.asc_getImage(),
|
||||||
|
name : me.textureNames[item.asc_getId()],
|
||||||
|
type : item.asc_getId(),
|
||||||
|
// 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: $('#shape-combo-fill-texture'),
|
el: $('#shape-combo-fill-texture'),
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -1440,26 +1455,20 @@ define([
|
||||||
});
|
});
|
||||||
this.textureMenu.render($('#shape-combo-fill-texture'));
|
this.textureMenu.render($('#shape-combo-fill-texture'));
|
||||||
this.fillControls.push(this.btnTexture);
|
this.fillControls.push(this.btnTexture);
|
||||||
}
|
|
||||||
var texturearray = [];
|
var onShowBefore = function(menu) {
|
||||||
_.each(texture, function(item){
|
|
||||||
texturearray.push({
|
|
||||||
imageUrl: item.asc_getImage(),
|
|
||||||
name : me.textureNames[item.asc_getId()],
|
|
||||||
type : item.asc_getId(),
|
|
||||||
// allowSelected : false,
|
|
||||||
selected: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
el: $('#id-shape-menu-texture'),
|
el: $('#id-shape-menu-texture'),
|
||||||
restoreHeight: 174,
|
restoreHeight: 174,
|
||||||
parentMenu: me.textureMenu,
|
parentMenu: menu,
|
||||||
showLast: false,
|
showLast: false,
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
itemTemplate: _.template('<div class="item-texture"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
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){
|
|
||||||
texturearray.push({
|
|
||||||
imageUrl: item.get_image(),
|
|
||||||
name : me.textureNames[item.get_id()],
|
|
||||||
type : item.get_id(),
|
|
||||||
selected: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
var mnuTexturePicker = new Common.UI.DataView({
|
var mnuTexturePicker = new Common.UI.DataView({
|
||||||
el: $('#id-textart-menu-texture'),
|
el: $('#id-textart-menu-texture'),
|
||||||
restoreHeight: 174,
|
restoreHeight: 174,
|
||||||
parentMenu: me.textureMenu,
|
parentMenu: menu,
|
||||||
showLast: false,
|
showLast: false,
|
||||||
store: new Common.UI.DataViewStore(texturearray),
|
store: new Common.UI.DataViewStore(me._texturearray || []),
|
||||||
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
itemTemplate: _.template('<div><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||||
});
|
});
|
||||||
mnuTexturePicker.on('item:click', _.bind(this.onSelectTexture, this));
|
mnuTexturePicker.on('item:click', _.bind(me.onSelectTexture, me));
|
||||||
|
menu.off('show:before', onShowBefore);
|
||||||
|
};
|
||||||
|
this.textureMenu.on('show:before', onShowBefore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue