diff options
author | NastuzziSamy <samy@nastuzzi.fr> | 2018-04-25 00:03:59 +0300 |
---|---|---|
committer | NastuzziSamy <samy@nastuzzi.fr> | 2018-04-25 00:03:59 +0300 |
commit | 7c4eabcd73e5f5aeaf4454f5836a161af539ad8c (patch) | |
tree | e34bb3a4e39f63a903135c70e6fa5ea83e80d115 | |
parent | afcb34b02a9b4620d3e7418c7e7a2a3c548674b4 (diff) |
Text unshown fixedv0.5.3
Issue #12 fixed
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | js/script.js | 40 |
2 files changed, 21 insertions, 21 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index ab7be16..07d07ab 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ <name>Files Right Click</name> <summary>Add a simple right click menu on the files Nextcloud app</summary> <description><![CDATA[Not anymore useful to click on the 3 dots button to popup the file menu, now right click on a specific file where you want to access to its menu to simply show it.]]></description> - <version>0.5.2</version> + <version>0.5.3</version> <licence>AGPL</licence> <author mail="samy@nastuzzi.fr" homepage="https://github.com/NastuzziSamy/files_rightclick.git">NASTUZZI Samy</author> <namespace>FilesRightClick</namespace> diff --git a/js/script.js b/js/script.js index f0764fc..e5c4c9b 100644 --- a/js/script.js +++ b/js/script.js @@ -32,31 +32,31 @@ var openContextOnRightClick = function (event) { var top = (event.pageY - currentFile.offset().top + (currentFile.height() / 4)); var left = event.pageX - currentFile.offset().left - leftToRemove - (menu.width() / 2) - 4; var generateNewOption = function (action, icon, text, onClick, prepend) { - if (prepend === undefined) - prepend = true; + if (prepend === undefined) + prepend = true; - var newOption = $('<li><a href="#" class="menuitem action action-' + action.toLowerCase() + ' permanent" data-action="' + action + '"><span class="icon icon-' + icon + '"></span><span>' + text + '</span></a></li>').on('click', function (event) { - event.stopPropagation(); - event.preventDefault(); + var newOption = $('<li><a href="#" class="menuitem action permanent" data-action="' + action + '"><span class="icon icon-' + icon + '"></span><span>' + text + '</span></a></li>').on('click', function (event) { + event.stopPropagation(); + event.preventDefault(); - menu.remove(); - currentFile.removeClass('mouseOver'); - currentFile.removeClass('highlighted'); - currentFile.find('.action-menu').removeClass('open'); + menu.remove(); + currentFile.removeClass('mouseOver'); + currentFile.removeClass('highlighted'); + currentFile.find('.action-menu').removeClass('open'); - onClick(); - }); + onClick(); + }); if (prepend) { - menu.find('ul').prepend( - newOption - ); - } - else { - menu.find('ul').append( - newOption - ); - } + menu.find('ul').prepend( + newOption + ); + } + else { + menu.find('ul').append( + newOption + ); + } }; menu.addClass('rightClickMenu'); |