Fix infinite recurrsion and fix button state of smart upload button
This commit is contained in:
parent
8b2c1e0cbd
commit
e250cb4101
1 changed files with 8 additions and 9 deletions
|
@ -401,10 +401,10 @@ function kolab_files_upload_input(button)
|
||||||
// Note: now, I observe problem with cursor style on FF < 4 only
|
// Note: now, I observe problem with cursor style on FF < 4 only
|
||||||
// Need position: relative (Bug #2615)
|
// Need position: relative (Bug #2615)
|
||||||
link.css({overflow: 'hidden', cursor: 'pointer', position: 'relative'})
|
link.css({overflow: 'hidden', cursor: 'pointer', position: 'relative'})
|
||||||
.mouseenter(function() { this.__isactive = true; })
|
.mouseenter(function() { this.__active = true; })
|
||||||
// place button under the cursor
|
// place button under the cursor
|
||||||
.mousemove(function(e) {
|
.mousemove(function(e) {
|
||||||
if (rcmail.commands['files-upload'] && this.__isactive)
|
if (rcmail.commands['files-upload'] && this.__active)
|
||||||
move_file_input(e);
|
move_file_input(e);
|
||||||
// move the input away if button is disabled
|
// move the input away if button is disabled
|
||||||
else
|
else
|
||||||
|
@ -412,17 +412,16 @@ function kolab_files_upload_input(button)
|
||||||
})
|
})
|
||||||
.mouseleave(function() {
|
.mouseleave(function() {
|
||||||
file.css({top: '-10000px', left: '-10000px'});
|
file.css({top: '-10000px', left: '-10000px'});
|
||||||
this.__isactive = false;
|
this.__active = false;
|
||||||
})
|
})
|
||||||
.attr('onclick', '') // remove default button action
|
.attr('onclick', '') // remove default button action
|
||||||
.click(function(e) {
|
.click(function(e) {
|
||||||
// forward click if mouse-enter event was missed
|
// forward click if mouse-enter event was missed
|
||||||
if (this.__isactive)
|
if (rcmail.commands['files-upload'] && !this.__active) {
|
||||||
return;
|
this.__active = true;
|
||||||
|
|
||||||
this.__isactive = true;
|
|
||||||
move_file_input(e);
|
move_file_input(e);
|
||||||
file.trigger(e);
|
file.trigger(e);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.mouseleave() // initially disable/hide input
|
.mouseleave() // initially disable/hide input
|
||||||
.append(file);
|
.append(file);
|
||||||
|
|
Loading…
Add table
Reference in a new issue