mockup/contextual-menu: Improved the drag and drop feature.

Oshane Bailey <jenkins-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: mockup
Branch: refs/heads/contextual-menu
Date: 2017-07-10T21:12:52-05:00
Author: Oshane Bailey (b4oshany) <[email protected]>
Commit: https://github.com/plone/mockup/commit/168e26a1bd3c548926f23fcc1d8fa1e113d45afe

Improved the drag and drop feature.

Files changed:
M mockup/patterns/filemanager/pattern.js
M mockup/patterns/filemanager/templates/app.xml

diff --git a/mockup/patterns/filemanager/pattern.js b/mockup/patterns/filemanager/pattern.js
index 8e613c7a..f4e194ad 100644
--- a/mockup/patterns/filemanager/pattern.js
+++ b/mockup/patterns/filemanager/pattern.js
@@ -171,6 +171,13 @@ define([
           tooltip: _t('Delete currently selected resource'),
           icon: 'trash',
           context: 'danger'
+        }),
+        "upload": new ButtonView({
+            id: 'upload',
+            title: _t('Upload'),
+            tooltip: _t('Upload file to current directory'),
+            icon: 'upload',
+            context: 'default'
         })
       };
 
@@ -208,7 +215,7 @@ define([
         id: 'find',
         app: self,
         disable: function() {}
-      })
+      });
 
       self.views = [
         newFolderView,
@@ -229,13 +236,7 @@ define([
 
       if (self.options.uploadUrl && utils.featureSupport.dragAndDrop() && utils.featureSupport.fileApi()) {
         var uploadView = new UploadView({
-          triggerView: new ButtonView({
-            id: 'upload',
-            title: _t('Upload'),
-            tooltip: _t('Upload file to current directory'),
-            icon: 'upload',
-            context: 'default'
-          }),
+          triggerView: self.btns["upload"],
           app: self,
           callback: function(data) {
             var path = self.uploadFolder + '/' + data.name;
diff --git a/mockup/patterns/filemanager/templates/app.xml b/mockup/patterns/filemanager/templates/app.xml
index 280faaad..519d6dad 100644
--- a/mockup/patterns/filemanager/templates/app.xml
+++ b/mockup/patterns/filemanager/templates/app.xml
@@ -22,4 +22,5 @@
     <li data-item="newfolder"><a>New Folder</a></li>
     <li data-item="rename"><a>Rename</a></li>
     <li data-item="delete"><a>Delete</a></li>
+    <li data-item="upload"><a>Upload Here</a></li>
 </ul>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.