Skip to content
Snippets Groups Projects
Commit 59624abc authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

tips: Auto-flip help tip pop-over

parent e21d6d9a
No related branches found
No related tags found
No related merge requests found
...@@ -958,6 +958,21 @@ h2 .reload { ...@@ -958,6 +958,21 @@ h2 .reload {
z-index:700; z-index:700;
} }
.tip_box.right .tip_arrow {
top: 5px;
right: -12px;
left: auto;
}
.flip-x {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
.tip_content { .tip_content {
height:auto !important; height:auto !important;
height:20px; height:20px;
...@@ -1082,6 +1097,7 @@ h2 .reload { ...@@ -1082,6 +1097,7 @@ h2 .reload {
} }
i.help-tip { i.help-tip {
vertical-align: inherit;
color: #aaa; color: #aaa;
} }
i.help-tip:hover { i.help-tip:hover {
......
...@@ -113,6 +113,7 @@ $page='dynamic-forms.inc.php'; ...@@ -113,6 +113,7 @@ $page='dynamic-forms.inc.php';
if($form || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) if($form || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add')))
$page='dynamic-form.inc.php'; $page='dynamic-form.inc.php';
$ost->addExtraHeader('<meta name="tip-namespace" content="forms" />');
$nav->setTabActive('manage'); $nav->setTabActive('manage');
require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.'header.inc.php');
require(STAFFINC_DIR.$page); require(STAFFINC_DIR.$page);
......
...@@ -74,8 +74,8 @@ jQuery(function() { ...@@ -74,8 +74,8 @@ jQuery(function() {
var elem = $(this), var elem = $(this),
pos = elem.offset(), pos = elem.offset(),
y_pos = pos.top - 12, y_pos = pos.top - 8,
x_pos = pos.left + elem.width() + 20, x_pos = pos.left + elem.width() + 16,
tip_arrow = $('<img>') tip_arrow = $('<img>')
.attr('src', './images/tip_arrow.png') .attr('src', './images/tip_arrow.png')
.addClass('tip_arrow'), .addClass('tip_arrow'),
...@@ -85,8 +85,7 @@ jQuery(function() { ...@@ -85,8 +85,7 @@ jQuery(function() {
.append('<a href="#" class="tip_close"><i class="icon-remove-circle"></i></a>') .append('<a href="#" class="tip_close"><i class="icon-remove-circle"></i></a>')
.addClass('tip_content'), .addClass('tip_content'),
the_tip = tip_box the_tip = tip_box
.append(tip_arrow) .append(tip_content.append(tip_arrow))
.append(tip_content)
.css({ .css({
"top":y_pos + "px", "top":y_pos + "px",
"left":x_pos + "px" "left":x_pos + "px"
...@@ -94,6 +93,12 @@ jQuery(function() { ...@@ -94,6 +93,12 @@ jQuery(function() {
tip_timer = setTimeout(function() { tip_timer = setTimeout(function() {
$('.tip_box').remove(); $('.tip_box').remove();
$('body').append(the_tip.hide().fadeIn()); $('body').append(the_tip.hide().fadeIn());
console.log($(window).width(), tip_content.width(), the_tip.position())
if ($(window).width() < tip_content.outerWidth() + the_tip.position().left) {
the_tip.css({'left':x_pos-tip_content.outerWidth()-40+'px'});
tip_box.addClass('right');
tip_arrow.addClass('flip-x');
}
}, 500); }, 500);
elem.live('mouseout', function() { elem.live('mouseout', function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment