Skip to content
Snippets Groups Projects
Commit ba905691 authored by Jared Hancock's avatar Jared Hancock
Browse files

tips: Allow tips in several namespaces on one page

parent 50150134
No related branches found
No related tags found
No related merge requests found
...@@ -53,8 +53,9 @@ jQuery(function() { ...@@ -53,8 +53,9 @@ jQuery(function() {
}, },
getHelpTips = (function() { getHelpTips = (function() {
var dfd, cache = {}; var dfd, cache = {};
return function(namespace) { return function(elem) {
var namespace = namespace var namespace =
$(elem).closest('[data-tip-namespace]').data('tipNamespace')
|| $('#content').data('tipNamespace') || $('#content').data('tipNamespace')
|| $('meta[name=tip-namespace]').attr('content'); || $('meta[name=tip-namespace]').attr('content');
if (!namespace) if (!namespace)
...@@ -147,7 +148,7 @@ jQuery(function() { ...@@ -147,7 +148,7 @@ jQuery(function() {
clearTimeout(tip_timer); clearTimeout(tip_timer);
}); });
getHelpTips().then(function(tips) { getHelpTips(elem).then(function(tips) {
var href = elem.attr('href'); var href = elem.attr('href');
if (href) { if (href) {
section = tips[elem.attr('href').substr(1)]; section = tips[elem.attr('href').substr(1)];
......
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