Files
sx-fc/app/assets/javascripts/OQS.js
2017-05-31 22:14:46 +06:30

38 lines
1.5 KiB
JavaScript

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require bootstrap
//= require jquery_ujs
//= require turbolinks
//= require cable
$(document).ready(function(){
$('.queue_station').on('click',function(){
var title=$(this).children().children('.card-title').text();
var titles=title.split(' ');
var orderBy=$(this).children().children().children().children('.order-by').text();
var orderAt=$(this).children().children().children().children('.order-at').text();
var orderCustomer=$(this).children().children('.order-customer').text();
$('#order-title').text($('#order-title').text() + titles[0]);
$('#order-by').text(orderBy);
$('#order-at').text(orderAt);
$('#order-customer').text(orderCustomer);
$('#order-from').text(titles[0]);
$('#order-items').text(titles[1]);
$('#order-qty').text(titles[2].substr(2).replace(']',''));
});
});