Fix user-select not working in FF

This commit is contained in:
Hadi Nategh 2016-03-29 12:49:05 +00:00
parent 3f6a9531cd
commit 25a52cb267
2 changed files with 17 additions and 12 deletions

View File

@ -2182,11 +2182,11 @@ egwActionObject.prototype.isDragOut = function (_event)
* -Others: Ctrl key * -Others: Ctrl key
* *
* @param {type} _event * @param {type} _event
* @returns {Boolean} return true if left mouse click and Ctrl key are pressed, otherwise false * @returns {Boolean} return true if left mouse click and Ctrl/Alt key are pressed, otherwise false
*/ */
egwActionObject.prototype.isSelection = function (_event) egwActionObject.prototype.isSelection = function (_event)
{ {
return !(_event.shiftKey) && _event.which == 1 && (_event.metaKey || _event.ctrlKey); return !(_event.shiftKey) && _event.which == 1 && (_event.metaKey || _event.ctrlKey || _event.altKey);
}; };
/** egwActionObjectInterface Interface **/ /** egwActionObjectInterface Interface **/

View File

@ -368,6 +368,11 @@ function egwDragActionImplementation()
{ {
var key = ["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform) < 0 ? var key = ["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform) < 0 ?
egw.lang("Ctrl") : egw.lang("Command ⌘"); egw.lang("Ctrl") : egw.lang("Command ⌘");
// We can not use Ctrl key for FF because FF has specific function
// for element selection bound to ctrl key and it would confilicts
// with our selection functionallity. Therefore, we use Alt key when
// it comes to FF regardless of OS.
if (window.navigator.userAgent.match(/firefox/i)) key = egw.lang("Alt");
egw.message(egw.lang('Hold [%1] key to select text eg. to copy it', key), 'info'); egw.message(egw.lang('Hold [%1] key to select text eg. to copy it', key), 'info');
} }