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

View File

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

View File

@ -51,7 +51,7 @@ $(function() {
} }
if($('.set-sidebar-state').length) { if($('.set-sidebar-state').length) {
if(window.localStorage.getItem('sidebarState') == 1) { 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({ $('.set-sidebar-state').on({
change: function() { change: function() {

View File

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