Author: sevein
Date: Thu Jun 28 16:09:37 2012
New Revision: 11830
Log:
Add simple logic to place the popover at right or left based in window size and
the element offset
Modified:
trunk/js/treeView.js
Modified: trunk/js/treeView.js
==============================================================================
--- trunk/js/treeView.js Thu Jun 28 15:51:24 2012 (r11829)
+++ trunk/js/treeView.js Thu Jun 28 16:09:37 2012 (r11830)
@@ -209,6 +209,25 @@
anchor.removeAttr('title');
}
+ $li.popover({ placement: function()
+ {
+ var width = window.innerWidth;
+
+ if (width < 500)
+ {
+ return 'bottom';
+ }
+
+ var left_pos = this.$element.offset().left;
+
+ if (width - left_pos < 550)
+ {
+ return 'left';
+ }
+
+ return 'right';
+
+ } });
$li.popover('show');
return this;
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.