BUGFIX: fixed rule value fields being hidden on load. BUGFIX: use delegate rather than live for select field changes as IE7/8 will not trigger live changes.

This commit is contained in:
Will Rossiter 2011-03-06 15:47:01 +13:00
parent 23ba211310
commit 062770da17
3 changed files with 10 additions and 8 deletions

View File

@ -296,11 +296,11 @@
statusMessage(userforms.message('REMOVED_OPTION')); statusMessage(userforms.message('REMOVED_OPTION'));
return false; return false;
}); });
/** /**
* Custom Rules Interface * Custom Rules Interface
*/ */
$(".customRules .conditionOption").live('change',function(){ $("body").delegate("select.conditionOption", 'change', function() {
var valueInput = $(this).siblings(".ruleValue"); var valueInput = $(this).siblings(".ruleValue");
if($(this).val() && $(this).val() !== "IsBlank" && $(this).val() !== "IsNotBlank") { if($(this).val() && $(this).val() !== "IsBlank" && $(this).val() !== "IsNotBlank") {

View File

@ -116,11 +116,13 @@
<a href="#" class="deleteCondition" title="<% _t('DELETE', 'Delete') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'Delete') %>" /></a> <a href="#" class="deleteCondition" title="<% _t('DELETE', 'Delete') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'Delete') %>" /></a>
</li> </li>
<% control CustomRules %> <% if CustomRules %>
<li> <% control CustomRules %>
<% include CustomRule %> <li>
</li> <% include CustomRule %>
<% end_control %> </li>
<% end_control %>
<% end_if %>
</ul> </ul>
</fieldset> </fieldset>
</div> </div>

View File

@ -23,6 +23,6 @@
<option value="ValueGreaterThanEqual" <% if ConditionOption = ValueGreaterThanEqual %>selected="selected"<% end_if %>><% _t('GREATERTHANEQUAL', 'Value Greater Than Or Equal') %></option> <option value="ValueGreaterThanEqual" <% if ConditionOption = ValueGreaterThanEqual %>selected="selected"<% end_if %>><% _t('GREATERTHANEQUAL', 'Value Greater Than Or Equal') %></option>
</select> </select>
<input type="text" class="ruleValue <% if Value %><% else %>hidden<% end_if %> customRuleField" name="{$FieldName}[CustomRules][$Pos][Value]" value="$Value" /> <input type="text" class="ruleValue <% if ConditionOption %><% if ConditionOption = IsBlank %>hidden<% else_if ConditionOption = IsNotBlank %>hidden<% end_if %><% else %>hidden<% end_if %> customRuleField" name="{$FieldName}[CustomRules][$Pos][Value]" value="$Value" />
<a href="#" class="deleteCondition" title="<% _t('DELETE', 'Delete') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'Delete') %>" /></a> <a href="#" class="deleteCondition" title="<% _t('DELETE', 'Delete') %>"><img src="cms/images/delete.gif" alt="<% _t('DELETE', 'Delete') %>" /></a>