Changeset 11636
- Timestamp:
- 03/01/11 15:59:19 (2 years ago)
- Files:
-
- modules/branches/2.9/core/advancedsettings.js (modified) (3 diffs)
- modules/branches/2.9/core/core.css (modified) (1 diff)
- modules/branches/2.9/core/page.advancedsettings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.9/core/advancedsettings.js
r11276 r11636 16 16 break; 17 17 } 18 var send_reload = $('#need_reload_block').size() == 0 ? '1':'0';18 var send_reload = $('#need_reload_block').size() == 0 ? '1':'0'; 19 19 $.ajax({ 20 20 type: 'POST', … … 42 42 } 43 43 if (data.saved) { 44 mythis.parent().delay(500).fadeOut();44 //remove save button 45 45 mythis.unbind('click', savebinder); 46 46 mythis.fadeOut('normal', function(){ 47 mythis.closest('tr').find('.savetd').hide(); 48 }); 49 50 //hide retor to defualt if its we have reverted to defualt 51 //should not be nesesary -MB 52 /* 53 input = mythis.closest('tr').find('input.valueinput').val() ; 54 defval = mythis.closest('tr').find('input.adv_set_default').attr('data-default') 55 console.log(input, defval) 56 if(input == defval){ 57 mythis.closest('tr').find('input.adv_set_default').fadeOut() 58 } 59 */ 47 60 // If they changed the page layout 48 61 switch (mykey) { … … 97 110 //show save button 98 111 $('.valueinput').bind('keyup keypress keydown paste change', function(){ 99 var myel = $(this).parent().next().next(); 112 var save = $(this).closest('tr').find('input.save'); 113 //this is hidden seperatly from the td due to some ie issues, hence we show it separately 114 $(this).closest('tr').find('.savetd').show(); 115 100 116 //if the value was changed since the last page refresh 101 117 if($(this).val() != $(this).attr('data-valueinput-orig')){ 102 myel.stop(true, true).delay(100).fadeIn();118 save.stop(true, true).delay(100).fadeIn(); 103 119 //only bind if not already bound 104 if (myel.children(".save").data("events") == undefined 105 || typeof(myel.children('.save').data('events')["click"]) == undefined 106 ) { 107 myel.children('.save').bind('click', savebinder); 120 if (save.data("events") == undefined || typeof(save.data('events')["click"]) == undefined) { 121 save.bind('click', savebinder); 108 122 } 109 123 //show 'revert to defualt' 110 $(this). parent().next().find('input').show()124 $(this).closest('tr').find('input.adv_set_default').show() 111 125 } else { 112 myel.stop(true, true).delay(100).fadeOut(); 113 myel.children('.save').unbind('click', savebinder); 126 save.stop(true, true).delay(100).fadeOut('normal', function(){ 127 $(this).closest('tr').find('.savetd').hide(); 128 $(this).closest('tr').find('input.adv_set_default').fadeOut() 129 }).unbind('click', savebinder); 114 130 } 115 131 modules/branches/2.9/core/core.css
r11583 r11636 19 19 } 20 20 .save, .adv_set_default{border-style: none;} 21 .savetd {display:none;}21 .savetd, .save{display:none;} modules/branches/2.9/core/page.advancedsettings.php
r11627 r11636 145 145 if(!$c['readonly'] || $amp_conf['AS_OVERRIDE_READONLY'] && !$c['hidden']){ 146 146 echo '<td><input type="image" class="adv_set_default" src="images/default-option.png" data-key="'.$c['keyword'].'" data-default="'.$c['defaultval'].'" title="'._('Revert to Default').'"' 147 . ' data-type="' . (($c['type'] == CONF_TYPE_BOOL) ? 'BOOL' : '') . '" '147 . ' data-type="' . (($c['type'] == CONF_TYPE_BOOL) ? 'BOOL' : '') . '" ' 148 148 . (($amp_conf[$c['keyword']] == $c['defaultval']) ? ' style="display:none" ' : '') 149 149 .'"></td>'; … … 151 151 . $c['keyword'] 152 152 . '" title="' . _('Save') . '"' 153 . ' data-type="' . (($c['type'] == CONF_TYPE_BOOL) ? 'BOOL' : '') . '" '153 . ' data-type="' . (($c['type'] == CONF_TYPE_BOOL) ? 'BOOL' : '') . '" ' 154 154 . '></td>'; 155 155 }
