Browse Source

Gii: minor JS fixes

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
9bed03384b
  1. 8
      framework/yii/gii/assets/gii.js

8
framework/yii/gii/assets/gii.js

@ -16,14 +16,14 @@ yii.gii = (function ($) {
var initStickyInputs = function () { var initStickyInputs = function () {
$('.sticky:not(.error) input,select,textarea').each(function () { $('.sticky:not(.error) input,select,textarea').each(function () {
var value; var value;
if (this.tagName == 'SELECT') { if (this.tagName === 'SELECT') {
value = this.options[this.selectedIndex].text; value = this.options[this.selectedIndex].text;
} else if (this.tagName == 'TEXTAREA') { } else if (this.tagName === 'TEXTAREA') {
value = $(this).html(); value = $(this).html();
} else { } else {
value = $(this).val(); value = $(this).val();
} }
if (value == '') { if (value === '') {
value = '[empty]'; value = '[empty]';
} }
$(this).before('<div class="sticky-value">' + value + '</div>').hide(); $(this).before('<div class="sticky-value">' + value + '</div>').hide();
@ -51,7 +51,7 @@ yii.gii = (function ($) {
$modal.find('.content').css('max-height', ($(window).height() - 200) + 'px'); $modal.find('.content').css('max-height', ($(window).height() - 200) + 'px');
}, },
error: function (XMLHttpRequest, textStatus, errorThrown) { error: function (XMLHttpRequest, textStatus, errorThrown) {
$modal.find('.modal-body').html('<div class="error">' + XMLHttpRequest.responseText + '</div>') $modal.find('.modal-body').html('<div class="error">' + XMLHttpRequest.responseText + '</div>');
} }
}); });
return false; return false;

Loading…
Cancel
Save