silverstripe-framework/admin/javascript/LeftAndMain.FieldHelp.js
Sam Minnee 1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00

28 lines
608 B
JavaScript

(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() {
var title = this.prop("title");
var field = this.closest(".field");
if(title && title.length && field.has('.help').length == 0) {
var span = $("<span></span>", {
"class": "help",
"text": title
});
field.append(span);
this.removeProp("title");
}
this._super();
}
});
});
}(jQuery));