Move some stuff out of document ready
This commit is contained in:
parent
f8d63052d4
commit
9d2653ecd4
1 changed files with 18 additions and 19 deletions
|
|
@ -1,31 +1,14 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
||||||
$('#debug_info').click(function() {
|
$('#debug_info').click(function() {
|
||||||
$('#debug_more').toggle('fast', function() {
|
$('#debug_more').toggle('fast');
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("label").inFieldLabels();
|
$("label").inFieldLabels();
|
||||||
|
|
||||||
$('#flash_notice, #flash_error, #flash_alert').delay(2500).slideUp(130);
|
$('#flash_notice, #flash_error, #flash_alert').delay(2500).slideUp(130);
|
||||||
|
|
||||||
//Called with $(selector).clearForm()
|
|
||||||
$.fn.clearForm = function() {
|
|
||||||
return this.each(function() {
|
|
||||||
var type = this.type, tag = this.tagName.toLowerCase();
|
|
||||||
if (tag == 'form')
|
|
||||||
return $(':input',this).clearForm();
|
|
||||||
if (type == 'text' || type == 'password' || tag == 'textarea')
|
|
||||||
this.value = '';
|
|
||||||
//else if (type == 'checkbox' || type == 'radio')
|
|
||||||
//this.checked = false;
|
|
||||||
else if (tag == 'select')
|
|
||||||
this.selectedIndex = -1;
|
|
||||||
$(this).blur();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$("div.image_cycle").cycle({
|
$("div.image_cycle").cycle({
|
||||||
fx: 'fade',
|
fx: 'fade',
|
||||||
|
|
@ -84,3 +67,19 @@ function pane_toggler_button( name ) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Called with $(selector).clearForm()
|
||||||
|
$.fn.clearForm = function() {
|
||||||
|
return this.each(function() {
|
||||||
|
var type = this.type, tag = this.tagName.toLowerCase();
|
||||||
|
if (tag == 'form')
|
||||||
|
return $(':input',this).clearForm();
|
||||||
|
if (type == 'text' || type == 'password' || tag == 'textarea')
|
||||||
|
this.value = '';
|
||||||
|
//else if (type == 'checkbox' || type == 'radio')
|
||||||
|
//this.checked = false;
|
||||||
|
else if (tag == 'select')
|
||||||
|
this.selectedIndex = -1;
|
||||||
|
$(this).blur();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue