2012-06-13 19:59:25 +10:00
|
|
|
(function($) {
|
|
|
|
$.entwine('ss', function($) {
|
|
|
|
/**
|
|
|
|
* Takes form fields with a title attribute, extracts it, and displays
|
|
|
|
* it as inline help text below the field.
|
|
|
|
*/
|
|
|
|
$(".cms form .field .middleColumn > [title]").entwine({
|
|
|
|
onmatch: function() {
|
2012-09-25 13:37:17 +12:00
|
|
|
|
2012-06-13 19:59:25 +10:00
|
|
|
var title = this.prop("title");
|
2012-09-25 13:37:17 +12:00
|
|
|
var field = this.closest(".field");
|
2012-06-13 19:59:25 +10:00
|
|
|
|
2012-09-25 13:37:17 +12:00
|
|
|
if(title && title.length && field.has('.help').length == 0) {
|
2012-06-13 19:59:25 +10:00
|
|
|
var span = $("<span></span>", {
|
|
|
|
"class": "help",
|
|
|
|
"text": title
|
|
|
|
});
|
|
|
|
|
2012-09-25 13:37:17 +12:00
|
|
|
field.append(span);
|
2012-06-13 19:59:25 +10:00
|
|
|
this.removeProp("title");
|
|
|
|
}
|
|
|
|
|
|
|
|
this._super();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}(jQuery));
|