mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
IconPanel reimplemented
This commit is contained in:
parent
6edaf3f30a
commit
c1c022c96b
@ -19,8 +19,7 @@
|
||||
mindplot.widget.IconPanel = new Class({
|
||||
Extends:mindplot.widget.ToolbarPaneItem,
|
||||
initialize:function (buttonId, model) {
|
||||
console.error("mindplot.widget.IconPanel");
|
||||
// this.parent(buttonId, model);
|
||||
this.parent(buttonId, model);
|
||||
},
|
||||
|
||||
_updateSelectedItem:function () {
|
||||
@ -29,9 +28,8 @@ mindplot.widget.IconPanel = new Class({
|
||||
},
|
||||
|
||||
buildPanel:function () {
|
||||
var content = new Element('div', {'class':'toolbarPanel', 'id':'IconsPanel'});
|
||||
content.setStyles({width:253, height:230, padding:5});
|
||||
content.addEvent("click", function (event) {
|
||||
var content = $('<div class="toolbarPanel" id="IconsPanel"></div>').css({width: 253, height: 230, padding: 5});
|
||||
content.on('click', function (event) {
|
||||
event.stopPropagation()
|
||||
});
|
||||
|
||||
@ -42,23 +40,25 @@ mindplot.widget.IconPanel = new Class({
|
||||
// Separate icons by line ...
|
||||
var familyContent;
|
||||
if ((count % 12) == 0) {
|
||||
familyContent = new Element('div').inject(content);
|
||||
familyContent = $('<div></div>');
|
||||
content.append(familyContent);
|
||||
}
|
||||
|
||||
var iconId = familyIcons[j];
|
||||
var img = new Element('img', {
|
||||
id:iconId,
|
||||
src:mindplot.ImageIcon.prototype._getImageUrl(iconId)
|
||||
});
|
||||
img.setStyles({width:16,
|
||||
height:16,
|
||||
padding:"0px 2px",
|
||||
cursor:'pointer'
|
||||
}).inject(familyContent);
|
||||
var img = $('<img>')
|
||||
.attr('id', iconId)
|
||||
.attr('src', mindplot.ImageIcon.prototype._getImageUrl(iconId))
|
||||
.css({
|
||||
width:16,
|
||||
height:16,
|
||||
padding:"0px 2px",
|
||||
cursor:'pointer'
|
||||
});
|
||||
familyContent.append(img);
|
||||
|
||||
var panel = this;
|
||||
var model = this.getModel();
|
||||
img.addEvent('click', function (event) {
|
||||
img.on('click', function (event) {
|
||||
model.setValue(this.id);
|
||||
panel.hide();
|
||||
}.bind(img));
|
||||
|
Loading…
Reference in New Issue
Block a user