Order queue stations
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
// about supported directives.
|
||||
//
|
||||
//= require jquery
|
||||
//= require tether
|
||||
//= require bootstrap
|
||||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require cable
|
||||
//= require settings/processing_items
|
||||
|
||||
46
app/assets/javascripts/settings/processing_items.js
Normal file
46
app/assets/javascripts/settings/processing_items.js
Normal file
@@ -0,0 +1,46 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$(".processitems").click(function(event){
|
||||
event.preventDefault();
|
||||
console.log($(this).data("id"));
|
||||
var item = $(this).data("id");
|
||||
$(this).toggleClass("opi_selected");
|
||||
|
||||
});
|
||||
|
||||
$(".processingitems_all").click(function(event){
|
||||
event.preventDefault();
|
||||
|
||||
console.log($(this).data("id"));
|
||||
var group_id = $(this).data("id");
|
||||
var selector = "#" + group_id + " li div";
|
||||
console.log ($(selector));
|
||||
|
||||
$(selector).removeClass("opi_selected");
|
||||
$(selector).addClass("opi_selected");
|
||||
});
|
||||
|
||||
$(".processingitems_clr").click(function(event){
|
||||
event.preventDefault();
|
||||
|
||||
console.log($(this).data("id"));
|
||||
var group_id = $(this).data("id");
|
||||
var selector = "#" + group_id + " li div";
|
||||
console.log ($(selector));
|
||||
|
||||
$(selector).removeClass("opi_selected");
|
||||
});
|
||||
|
||||
//Process the menu item data before submitting
|
||||
$("form").submit(function(e){
|
||||
//e.preventDefault();
|
||||
var items = new Array();
|
||||
selected_div = $(".opi_selected");
|
||||
$.each( selected_div, function( key, value ) {
|
||||
console.log($(value).attr("data-id"));
|
||||
items.push($(value).attr("data-id"));
|
||||
});
|
||||
|
||||
$("#order_queue_station_processing_items").val(items);
|
||||
//$(this).submit();
|
||||
})
|
||||
})
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "tether";
|
||||
@import "bootstrap";
|
||||
@import "font-awesome";
|
||||
@import "theme";
|
||||
@@ -7,3 +8,25 @@
|
||||
// min-height: 75rem;
|
||||
// padding-top: 4.5rem;
|
||||
// }
|
||||
|
||||
/*----- Order Processing Items -----*/
|
||||
.opi_ul {
|
||||
display:block;
|
||||
padding-left:0px;
|
||||
}
|
||||
.opi_ul li {
|
||||
display:list-item;
|
||||
list-style: none;
|
||||
margin-top:2px;
|
||||
}
|
||||
|
||||
.opi_selected {
|
||||
background-color:#BEA2C2 !important;
|
||||
}
|
||||
.opi_default {
|
||||
cursor: pointer;
|
||||
background-color: #E8ECF9;
|
||||
line-height: inherit;
|
||||
padding:5px;
|
||||
}
|
||||
/*----- Order Processing Items -----*/
|
||||
|
||||
Reference in New Issue
Block a user