commit/galaxy-central: guerler: Fix event handling, tooltip
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d748871f160f/ Changeset: d748871f160f User: guerler Date: 2013-06-30 08:34:19 Summary: Fix event handling, tooltip Affected #: 1 file diff -r 019ad31c3c2502005846dadc5c0457bbb6f80712 -r d748871f160f9bf1b13df57d34a9f3cf13a9f947 static/scripts/galaxy.frame.js --- a/static/scripts/galaxy.frame.js +++ b/static/scripts/galaxy.frame.js @@ -91,8 +91,8 @@ $(this.el).append(this.frame_template_menu()); // load load button - $(this.el_header).append(this.frame_template_load()); - + $(this.el_header).append(this.frame_template_header()); + // // define shadow frame // @@ -121,7 +121,11 @@ // link events this.event_initialize(); - + + // add + $(".galaxy-frame-active").tooltip({title: "Enable/Disable Scratchbook"}); + $(".galaxy-frame-load").tooltip({title: "Show/Hide Scratchbook"}); + // catch window resize event var self = this; $(window).resize(function () @@ -162,7 +166,6 @@ {*/ this.events = { // global page events - 'mousedown' : 'event_frame_mouse_down', 'mousemove' : 'event_frame_mouse_move', 'mouseup' : 'event_frame_mouse_up', 'mouseleave' : 'event_frame_mouse_up', @@ -170,13 +173,14 @@ 'DOMMouseScroll' : 'event_panel_scroll', // events fixed to elements - 'mousedown .f-close' : 'event_frame_close', - 'mousedown .f-pin' : 'event_frame_lock', + 'mousedown .galaxy-frame' : 'event_frame_mouse_down', 'mousedown .galaxy-frame-active' : 'event_panel_active', 'mousedown .galaxy-frame-load' : 'event_panel_load', 'mousedown .galaxy-frame-background' : 'event_panel_load', 'mousedown .galaxy-frame-scroll-up' : 'event_panel_scroll_up', - 'mousedown .galaxy-frame-scroll-down' : 'event_panel_scroll_down' + 'mousedown .galaxy-frame-scroll-down' : 'event_panel_scroll_down', + 'mousedown .f-close' : 'event_frame_close', + 'mousedown .f-pin' : 'event_frame_lock' }; /*} else { this.events = { @@ -197,9 +201,6 @@ // drag start event_frame_mouse_down: function (e) { - // prevent text selection - e.preventDefault(); - // skip if event is already active if (this.event.type !== null) return; @@ -212,11 +213,14 @@ // check for resize event if ($(e.target).hasClass('f-resize')) this.event.type = 'resize'; - + // skip if no event has to be handled if (this.event.type === null) return; - + + // prevent text selection + e.preventDefault(); + // identify frame this.event.target = this.event_get_frame(e.target); @@ -1044,13 +1048,13 @@ }, // fill load button template - frame_template_load: function() + frame_template_header: function() { return '<div class="galaxy-frame-load f-corner">' + '<div class="number f-corner">0</div>' + '<div class="icon fa-icon-2x"></div>' + - '</div>'+ - '<div class="galaxy-frame-active f-corner">' + + '</div>' + + '<div class="galaxy-frame-active f-corner" style="position: absolute; top: 8px;">' + '<div class="icon fa-icon-2x fa-icon-th"></div>' + '</div>'; }, Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org