2 commits - plugins/kolab_files
Aleksander Machniak
machniak at kolabsys.com
Mon Dec 2 14:58:14 CET 2013
plugins/kolab_files/kolab_files.js | 30 ++++++++++---
plugins/kolab_files/skins/larry/style.css | 1
plugins/kolab_files/skins/larry/templates/filepreview.html | 1
plugins/kolab_files/skins/larry/templates/files.html | 1
4 files changed, 25 insertions(+), 8 deletions(-)
New commits:
commit 59cc22c85286de440e5845b6831101383428192e
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Mon Dec 2 14:57:55 2013 +0100
Remove deprecated #message elements
diff --git a/plugins/kolab_files/skins/larry/style.css b/plugins/kolab_files/skins/larry/style.css
index e5f56b4..2aa2735 100644
--- a/plugins/kolab_files/skins/larry/style.css
+++ b/plugins/kolab_files/skins/larry/style.css
@@ -86,7 +86,6 @@
}
#filelistbox {
- bottom: 28px;
overflow: auto;
top: 0;
left: 0;
diff --git a/plugins/kolab_files/skins/larry/templates/filepreview.html b/plugins/kolab_files/skins/larry/templates/filepreview.html
index bc35752..1ab6190 100644
--- a/plugins/kolab_files/skins/larry/templates/filepreview.html
+++ b/plugins/kolab_files/skins/larry/templates/filepreview.html
@@ -28,7 +28,6 @@
<div class="iframebox">
<roundcube:object name="filepreviewframe" id="fileframe" frameborder="0" />
</div>
- <roundcube:object name="message" id="message" class="statusbar" />
</div>
</div>
diff --git a/plugins/kolab_files/skins/larry/templates/files.html b/plugins/kolab_files/skins/larry/templates/files.html
index dd0bc16..e3af092 100644
--- a/plugins/kolab_files/skins/larry/templates/files.html
+++ b/plugins/kolab_files/skins/larry/templates/files.html
@@ -41,7 +41,6 @@
<div id="filelistbox" class="boxlistcontent">
<roundcube:object name="filelist" id="filelist" class="records-table filelist sortheader fixedheader" optionsmenuIcon="true" />
</div>
- <roundcube:object name="message" id="message" class="statusbar" />
</div>
</div>
commit de8067b11940bda01002adcd709f9f0a6690226f
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Mon Dec 2 14:55:59 2013 +0100
Fixed smart upload button issues (Bug #2615)
diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js
index dba947f..a70fb73 100644
--- a/plugins/kolab_files/kolab_files.js
+++ b/plugins/kolab_files/kolab_files.js
@@ -383,10 +383,15 @@ function kolab_files_upload_input(button)
file = $('<input>'),
offset = link.offset();
+ function move_file_input(e) {
+ file.css({top: (e.pageY - offset.top - 10) + 'px', left: (e.pageX - offset.left - 10) + 'px'});
+ }
+
file.attr({name: 'file[]', type: 'file', multiple: 'multiple', size: 5})
.change(function() { rcmail.files_upload('#filesuploadform'); })
+ .click(function() { setTimeout(function() { link.mouseleave(); }, 20); })
// opacity:0 does the trick, display/visibility doesn't work
- .css({opacity: 0, cursor: 'pointer', outline: 'none', position: 'absolute', top: '10000px', left: '10000px'});
+ .css({opacity: 0, cursor: 'pointer', outline: 'none', position: 'absolute'});
// In FF and IE we need to move the browser file-input's button under the cursor
// Thanks to the size attribute above we know the length of the input field
@@ -394,17 +399,32 @@ function kolab_files_upload_input(button)
file.css({marginLeft: '-80px'});
// Note: now, I observe problem with cursor style on FF < 4 only
- link.css({overflow: 'hidden', cursor: 'pointer'})
+ // Need position: relative (Bug #2615)
+ link.css({overflow: 'hidden', cursor: 'pointer', position: 'relative'})
+ .mouseenter(function() { this.__isactive = true; })
// place button under the cursor
.mousemove(function(e) {
- if (rcmail.commands['files-upload'])
- file.css({top: (e.pageY - offset.top - 10) + 'px', left: (e.pageX - offset.left - 10) + 'px'});
+ if (rcmail.commands['files-upload'] && this.__isactive)
+ move_file_input(e);
// move the input away if button is disabled
else
$(this).mouseleave();
})
- .mouseleave(function() { file.css({top: '10000px', left: '10000px'}); })
+ .mouseleave(function() {
+ file.css({top: '-10000px', left: '-10000px'});
+ this.__isactive = false;
+ })
.attr('onclick', '') // remove default button action
+ .click(function(e) {
+ // forward click if mouse-enter event was missed
+ if (this.__isactive)
+ return;
+
+ this.__isactive = true;
+ move_file_input(e);
+ file.trigger(e);
+ })
+ .mouseleave() // initially disable/hide input
.append(file);
};
More information about the commits
mailing list