Adds a nice tooltip when hovering over the content/media picker

#U4-192 Fixed
This commit is contained in:
Sebastiaan Janssen
2012-10-06 11:46:37 -02:00
parent 392fbb836f
commit 7bc2375a77
2 changed files with 32 additions and 6 deletions

View File

@@ -127,4 +127,13 @@
}
.footer .status{height: 12px; margin: 0px; overflow: hidden; background: url(images/footer_statusBar_bg.gif) top left no-repeat;}
.footer .status h2{display: block; height: 12px; overflow: hidden; margin: 0px; padding: 0px; background: url(images/footer_statusBar_h2_bg.gif) top right no-repeat;}
.footer .status h2{display: block; height: 12px; overflow: hidden; margin: 0px; padding: 0px; background: url(images/footer_statusBar_h2_bg.gif) top right no-repeat;}
.treePickerTooltip {
display: none;
position: absolute;
border: 1px solid #333;
background-color: #fff8cb;
padding: 3px;
color: #000;
}

View File

@@ -6,8 +6,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
Umbraco.Controls.TreePicker = function(clientId, label, itemIdValueClientID, itemTitleClientID, itemPickerUrl, width, height, showHeader, umbracoPath) {
var obj = {
_itemPickerUrl: itemPickerUrl,
//_webServiceUrl: umbracoPath + "/webservices/legacyAjaxCalls.asmx/GetNodeName", // legacy service returns string with just node name
_webServiceUrl: umbracoPath + "/webservices/legacyAjaxCalls.asmx/GetNodeBreadcrumbs", // new service returns array representing path/breadcrumbs
_webServiceUrl: umbracoPath + "/webservices/legacyAjaxCalls.asmx/GetNodeBreadcrumbs",
_label: label,
_width: width,
_height: height,
@@ -64,17 +63,35 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls");
Umbraco.Controls.TreePicker.inst[clientId] = obj;
return obj;
}
};
$(document).ready(function () {
// Tooltip only Text
$('.treePickerTitle').hover(function () {
// Hover over code
var title = $(this).attr('title');
$(this).data('tipText', title).removeAttr('title');
$('<p class="treePickerTooltip"></p>').text(title).appendTo('body').fadeIn('fast');;
}, function () {
// Hover out code
$(this).attr('title', $(this).data('tipText'));
$('.treePickerTooltip').remove();
}).mousemove(function (e) {
var mousex = e.pageX + 10; //Get X coordinates
var mousey = e.pageY + 5; //Get Y coordinates
$('.treePickerTooltip').css({ top: mousey, left: mousex });
});
});
// Static methods
//return the existing picker object based on client id of the control
Umbraco.Controls.TreePicker.GetPickerById = function(id) {
return Umbraco.Controls.TreePicker.inst[id] || null;
};
// instance manager
Umbraco.Controls.TreePicker.cntr = 0;
Umbraco.Controls.TreePicker.inst = {};
})(jQuery);