Move js into a file for status in form
This commit is contained in:
parent
579bc3c245
commit
911cfdc980
|
@ -0,0 +1,10 @@
|
|||
$(function() {
|
||||
$(document).on('click',"*[data-toggle=buttons-checkbox] input",function(){
|
||||
var d = $(this).parent().find("input[type=hidden]");
|
||||
if($(this).is(":checked")){
|
||||
d.val("1");
|
||||
}else{
|
||||
d.val("0");
|
||||
}
|
||||
})
|
||||
});
|
|
@ -9,6 +9,7 @@
|
|||
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
||||
<%= javascript_include_tag "lib/modal-preview" %>
|
||||
<%= javascript_include_tag "lib/file-type" %>
|
||||
<%= javascript_include_tag "lib/module-area" %>
|
||||
<% end %>
|
||||
|
||||
<%= f.error_messages %>
|
||||
|
@ -307,15 +308,6 @@
|
|||
$(this).parents('.start-line').hide();
|
||||
}
|
||||
});
|
||||
$(document).on('click',"*[data-toggle=buttons-checkbox] input",function(){
|
||||
var d = $(this).parent().find("input[type=hidden]");
|
||||
if($(this).is(":checked")){
|
||||
d.val("1");
|
||||
}else{
|
||||
d.val("0");
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
||||
<%= javascript_include_tag "lib/file-type" %>
|
||||
<%= javascript_include_tag "lib/module-area" %>
|
||||
<% end %>
|
||||
|
||||
<%= f.error_messages %>
|
||||
|
|
Loading…
Reference in New Issue