local changes from server
[fnpeditor.git] / src / editor / plugins / core / links / linkElement.js
index 61d2abc..36163d1 100644 (file)
@@ -9,6 +9,7 @@ var $ = require('libs/jquery'),
     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);
 
 
@@ -52,7 +53,8 @@ _.extend(linkElement, {
                 {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">attachment library</a>'
             }
             ]
         });
@@ -74,6 +76,10 @@ _.extend(linkElement, {
             });
         });
         dialog.show();
+        $(".attachment-library", dialog.$el).on('click', function() {
+            attachments.select(function(v) {$("input", dialog.$el).val(v);});
+        });
+
     },
 
     deleteLink: function() {