Rays fixes

This commit is contained in:
saurabhbhatia 2013-11-08 12:53:06 +08:00
parent 0db28d9ab4
commit 2f61f55be2
4 changed files with 11 additions and 13 deletions

View File

@ -38,9 +38,11 @@ if($.support.touch) {
$checked.each(function() {
if(!$(this).closest('div').hasClass('togglebox')) {
$(this).wrap('<div class="toggle-control"/>');
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
$(this).wrap('<div class="togglebox disabled" />');
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
console.log('true')
$(this).wrap('<div class="togglebox disable" />');
} else {
console.log('false')
$(this).wrap('<div class="togglebox" />');
}
$('<label><b></b></label>').insertAfter($(this));
@ -541,6 +543,7 @@ function changeStatusHidden() {
// Document Ready
$(function() {
console.log('true')
showFiltersOnPageRefresh();
new ini();

View File

@ -222,7 +222,7 @@ $(function() {
});
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
if($(this).hasClass('disable')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
@ -237,7 +237,7 @@ $(function() {
.children('.attributes-body')
.fadeOut(300);
}
$(this).toggleClass('disabled');
$(this).toggleClass('disable');
};
if($(this).hasClass('remove-input')) {
$(this).closest('.input-append').fadeOut(300, function() {
@ -382,7 +382,7 @@ $(function() {
});
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
if($(this).hasClass('disable')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
@ -411,7 +411,7 @@ $(function() {
$(this).parent('.field-type').removeClass('in');
});
}
$(this).toggleClass('disabled');
$(this).toggleClass('disable');
};
if($(this).hasClass('delete')) {
$(this).closest('.attributes').fadeOut(300, function() {

View File

@ -51,7 +51,7 @@ $(function() {
}
if($('.set-sidebar-state').length) {
if(window.localStorage.getItem('sidebarState') == 1) {
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
}
$('.set-sidebar-state').on({
change: function() {

View File

@ -5,12 +5,7 @@
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
<div class="attributes-header clearfix">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<label><b></b></label>
</div>
</div>
<h4><%= role.title %><%= t(:role_info)%></h4>
</div>