genericElement = require('modules/documentCanvas/canvas/genericElement'),
Dialog = require('views/dialog/dialog'),
boxTemplate = require('libs/text!./box.html'),
+ attachments = require('views/attachments/attachments'),
linkElement = Object.create(genericElement);
this.box.hide();
this.addWidget(this.box);
},
- markAsCurrent: function(toggle) {
- this.box.toggle(toggle);
+ onStateChange: function(changes) {
+ genericElement.onStateChange.call(this, changes);
+ if(_.isBoolean(changes.active)) {
+ this.box.toggle(changes.active);
+ }
},
onNodeAttrChange: function(event) {
if(event.meta.attr === 'href') {
{label: gettext('Link'), name: 'href', type: 'input', initialValue: el.wlxmlNode.getAttr('href'),
prePasteHandler: function(text) {
return this.wlxmlNode.document.getLinkForUrl(text);
- }.bind(this)
+ }.bind(this),
+ description: '<a href="#-" class="attachment-library">' + gettext('attachment library') + '</a>'
}
]
});
});
});
dialog.show();
+ $(".attachment-library", dialog.$el).on('click', function() {
+ attachments.select(function(v) {$("input", dialog.$el).val(v);});
+ });
+
},
deleteLink: function() {