- Timestamp:
- 01/07/12 23:00:41 (5 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
inc/js/jquery.webForms.js (modified) (4 diffs)
-
templates/base/css/forms.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/js/jquery.webForms.js
r15845 r15848 11 11 12 12 $(this).addNonWebForms(); 13 13 14 14 // switchers 15 15 $('.bx-switcher-cont', this).each(function() { … … 34 34 35 35 eInput.on('enable', function () { 36 if ('checked' != $(this).attr('checked')) { 37 console.log('onEnable'); 36 if ('checked' != $(this).attr('checked')) 38 37 $(this).attr('checked', 'checked').trigger('change'); 39 }40 38 if (!eSwitcher.hasClass('on')) 41 39 eSwitcher.removeClass('off').addClass('on'); … … 43 41 44 42 eInput.on('disable', function () { 45 if (undefined != $(this).attr('checked')) { 46 console.log('onDisable'); 43 if (undefined != $(this).attr('checked')) 47 44 $(this).removeAttr('checked').trigger('change'); 48 }49 45 if (!eSwitcher.hasClass('off')) 50 46 eSwitcher.removeClass('on').addClass('off'); … … 253 249 } 254 250 251 // add clear input button 252 var eInput = $(this); 253 var aClearInputClassSelectors = ['.bx-form-input-wrapper-datetime', '.bx-form-input-wrapper-datepicker', '.bx-form-input-wrapper-text', '.bx-form-input-wrapper-password']; 254 for (var i in aClearInputClassSelectors) { 255 var sClassSelector = aClearInputClassSelectors[i]; 256 257 var eWrapper = $(this).parents().filter(sClassSelector); 258 if (!eWrapper.length) 259 continue; 260 if (eWrapper.hasClass('bx-form-input-btn-cross-processed')) 261 return; 262 eWrapper.addClass('bx-form-input-btn-cross-processed'); 263 264 if ('relative' != eWrapper.css('position') && 'absolute' != eWrapper.css('position')) 265 eWrapper.css('position', 'relative'); 266 eWrapper.append('<a href="javascript:void(0);"><div class="bx-form-input-btn-cross"></div></a>'); 267 eInput.css('padding-right', parseInt(eInput.css('padding-right')) + 10 + 'px'); 268 var eBtnCross = eWrapper.find('.bx-form-input-btn-cross'); 269 var iLeft = eInput.outerWidth() - eBtnCross.outerWidth() - 8; 270 eBtnCross.css('left', iLeft + 'px').on('click', function () { 271 eInput.val(''); 272 if (!eInput.hasClass('bx-form-input-datetime') && !eInput.hasClass('bx-form-input-datepicker')) 273 eInput.focus(); 274 }); 275 } 276 255 277 }); 256 278 return this; -
trunk/templates/base/css/forms.css
r15844 r15848 187 187 188 188 .bx-form-input-datepicker { 189 width:1 10px;189 width:120px; 190 190 } 191 191 192 192 .bx-form-input-datetime { 193 width:1 90px;193 width:180px; 194 194 } 195 195 … … 354 354 } 355 355 356 .bx-form-input-btn-cross { 357 position:absolute; 358 top:11px; 359 left:10px; 360 width:16px; 361 height:16px; 362 363 background-image:url(../images/icons/cross-script.png); 364 } 365 356 366 /* extra features */ 357 367
Note: See TracChangeset
for help on using the changeset viewer.