-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add rm-hints to field and template gui
- Loading branch information
1 parent
b3c9add
commit 27b5b25
Showing
2 changed files
with
53 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
// fix language tabs sometimes not having the correct language | ||
$(window).load(function() { | ||
if(typeof ProcessWire == 'undefined') return; | ||
if(typeof ProcessWire.config == 'undefined') return; | ||
if(typeof ProcessWire.config.rmUserLang == 'undefined') return; | ||
$(window).load(function () { | ||
if (typeof ProcessWire == "undefined") return; | ||
if (typeof ProcessWire.config == "undefined") return; | ||
if (typeof ProcessWire.config.rmUserLang == "undefined") return; | ||
let lang = ProcessWire.config.rmUserLang; | ||
setTimeout(() => { | ||
let tabs = $(".langTab"+lang); | ||
if(!tabs.length) return; | ||
let tabs = $(".langTab" + lang); | ||
if (!tabs.length) return; | ||
tabs.click(); | ||
console.log('LanguageTabs set via RockMigrations'); | ||
console.log("LanguageTabs set via RockMigrations"); | ||
}, 200); | ||
}); | ||
|
||
// add tooltips in the backend | ||
$(document).ready(() => { | ||
let addTooltip = function (el) { | ||
let name = el.name; | ||
if (name == "templateLabel") name = "label"; | ||
else if (name == "field_label") name = "label"; | ||
else if (name == "asmSelect0") return; | ||
$(el).attr("title", name + " = " + el.value); | ||
UIkit.tooltip(el); | ||
console.log("added tooltip", el, el.value); | ||
}; | ||
$( | ||
".rm-hints input[name], .rm-hints textarea[name], .rm-hints select[name]" | ||
).each((i, el) => { | ||
addTooltip(el); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters