r51152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51151‎ | r51152 | r51153 >
Date:12:01, 29 May 2009
Author:jojo
Status:ok
Tags:
Comment:
JS code adjusted to changes in 51151
Modified paths:
  • /trunk/extensions/Collection/collection/collection.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/collection/collection.js
@@ -128,21 +128,21 @@
129129 }
130130
131131 function update_save_button() {
132 - if (!jQuery('#saveButton').get(0)) {
 132+ if (!jQuery('#saveButton').length) {
133133 return;
134134 }
135 - if (jQuery('#emptyCollection').get(0)) {
 135+ if (jQuery('#emptyCollection').length) {
136136 jQuery('#saveButton').attr('disabled', 'disabled');
137137 return;
138138 }
139 - if (jQuery('#personalCollType:checked').val()) {
 139+ if (!jQuery('#communityCollTitle').length || jQuery('#personalCollType:checked').val()) {
140140 jQuery('#personalCollTitle').attr('disabled', '');
141141 jQuery('#communityCollTitle').attr('disabled', 'disabled');
142142 if (!jQuery.trim(jQuery('#personalCollTitle').val())) {
143143 jQuery('#saveButton').attr('disabled', 'disabled');
144144 return;
145145 }
146 - } else if (jQuery('#communityCollType:checked').val()) {
 146+ } else if (!jQuery('#personalCollTitle').length || jQuery('#communityCollType:checked').val()) {
147147 jQuery('#communityCollTitle').attr('disabled', '');
148148 jQuery('#personalCollTitle').attr('disabled', 'disabled');
149149 if (!jQuery.trim(jQuery('#communityCollTitle').val())) {
@@ -167,7 +167,7 @@
168168 jQuery('#collectionListContainer').html(xhr.responseText);
169169 jQuery('.makeVisible').css('display', 'inline');
170170 make_sortable();
171 - if (jQuery('#emptyCollection').get(0)) {
 171+ if (jQuery('#emptyCollection').length) {
172172 jQuery('#downloadButton').attr('disabled', 'disabled');
173173 jQuery('input.order').attr('disabled', 'disabled');
174174 } else {
@@ -194,7 +194,7 @@
195195 alert('ERROR: Version mismatch between Javascript and PHP code. Contact admin to fix the installation of Collection extension for MediaWiki.');
196196 return;
197197 }
198 - if (jQuery('#collectionList').get(0)) {
 198+ if (jQuery('#collectionList').length) {
199199 jQuery('.makeVisible').css('display', 'inline');
200200 window.coll_create_chapter = create_chapter;
201201 window.coll_remove_item = remove_item;

Status & tagging log