User Order step1
This commit is contained in:
parent
eb55b01b0d
commit
a5db985ae8
90 changed files with 6439 additions and 421 deletions
|
|
@ -163,7 +163,9 @@ border: #b5c49b 1px solid;
|
|||
.btn-text-500{
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btn-text-400{
|
||||
font-weight: 500;
|
||||
}
|
||||
div.shop-item-buttons .btn-xs {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,4 +73,8 @@ a[aria-expanded='true'] > .fa-caret-expand:before {
|
|||
|
||||
.has-error .help-block{
|
||||
color: #a94442;
|
||||
}
|
||||
|
||||
.no-line-break {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
|
@ -98,9 +98,12 @@ $(function () {
|
|||
}
|
||||
var data = {};
|
||||
$.each(button.data(), function(index, value){
|
||||
data[index] = value;
|
||||
if(index !== 'bs.tooltip'){
|
||||
data[index] = value;
|
||||
}
|
||||
});
|
||||
//console.log(data);
|
||||
console.log(data);
|
||||
|
||||
loadModalInner(this, data);
|
||||
|
||||
});
|
||||
|
|
@ -111,7 +114,9 @@ $(function () {
|
|||
button = $(this);
|
||||
var data = {};
|
||||
$.each(button.data(), function(index, value){
|
||||
data[index] = value;
|
||||
if(index !== 'bs.tooltip'){
|
||||
data[index] = value;
|
||||
}
|
||||
});
|
||||
//console.log(data);
|
||||
loadModalInner(this, data);
|
||||
|
|
@ -133,7 +138,7 @@ $(function () {
|
|||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(data) {
|
||||
//console.log(data);
|
||||
console.log(data);
|
||||
if(data.response.modal){
|
||||
$(data.response.target).find('.modal-dialog').addClass(data.response.modal);
|
||||
}
|
||||
|
|
|
|||
106
public/js/shopping_card.js
Normal file
106
public/js/shopping_card.js
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
|
||||
var ShoppingCard = {
|
||||
|
||||
|
||||
image_dialog_images_url: "/iq/content/assets/modal",
|
||||
image_dialog_title: 'Medien',
|
||||
image_dialog_close_btn_text: 'schließen',
|
||||
image_dialog_ok_btn_text: 'Einfügen',
|
||||
data_id: null,
|
||||
data_obj: null,
|
||||
data_set: null,
|
||||
data_img: null,
|
||||
data_content: null,
|
||||
modal: null,
|
||||
|
||||
init: function () {
|
||||
var _self = this;
|
||||
var $modal = _self.modal = $('#modal_iq_assets').hide();
|
||||
$modal.find("button#modal_iq_save").click(function(event)
|
||||
{
|
||||
var items = LFileManager.getSelectedItems();
|
||||
$modal.modal('hide');
|
||||
if(items[0]){
|
||||
var item = items[0];
|
||||
if(_self.data_img){
|
||||
var img = $(_self.data_id).find(_self.data_img);
|
||||
if(item['thumb_url'] && img){
|
||||
img.attr('src', item['thumb_url']);
|
||||
}
|
||||
}
|
||||
//console.log(_self.data_content);
|
||||
//console.log(item['content']);
|
||||
if(_self.data_content){
|
||||
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+_self.data_content+']"]');
|
||||
var val = item['content'][_self.data_content];
|
||||
//console.log(input);
|
||||
//console.log(val);
|
||||
|
||||
if(input){
|
||||
input.val(val).change();
|
||||
}
|
||||
}
|
||||
_self.data_set.forEach(function (setter, index) {
|
||||
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+setter+']"]');
|
||||
var val = item[setter]
|
||||
if(input && val){
|
||||
input.val(val).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
/*items.forEach(function (item, index) {
|
||||
});*/
|
||||
});
|
||||
|
||||
$('.btn-lfm-open-modal').on('click', function () {
|
||||
|
||||
_self.data_id = $(this).data('id');
|
||||
_self.data_obj = $(this).data('obj');
|
||||
_self.data_set = $(this).data('set');
|
||||
_self.data_img = $(this).data('img');
|
||||
_self.data_content = $(this).data('content');
|
||||
|
||||
_self.fillModal();
|
||||
_self.modal.modal();
|
||||
});
|
||||
},
|
||||
|
||||
fillModal: function () {
|
||||
var _self = this;
|
||||
var next = _self.setEvents;
|
||||
_self.getImagesFromUrl(next);
|
||||
},
|
||||
setEvents: function()
|
||||
{
|
||||
// images click event to select image
|
||||
/*self.$modal.find('img').click(function(event)
|
||||
{
|
||||
// $(this).toggleClass(self.select_class);
|
||||
});*/
|
||||
},
|
||||
getImagesFromUrl: function(callback)
|
||||
{
|
||||
var _self = this;
|
||||
// get images html from url
|
||||
$.get(_self.image_dialog_images_url, function(html)
|
||||
{
|
||||
_self.setModalHtml(html);
|
||||
callback();
|
||||
|
||||
}).fail(function()
|
||||
{
|
||||
console.error("error loading from "+_self.image_dialog_images_url);
|
||||
})
|
||||
},
|
||||
setModalHtml: function(html)
|
||||
{ // set variabl parts to modal html
|
||||
var _self = this;
|
||||
|
||||
_self.modal.find('.modal-title').html(_self.image_dialog_title);
|
||||
_self.modal.find('#modal_iq_close').html(_self.image_dialog_close_btn_text);
|
||||
_self.modal.find('#modal_iq_save').html(_self.image_dialog_ok_btn_tex);
|
||||
|
||||
_self.modal.find('.modal-body').html(html);
|
||||
LFileManager.initFileManager(true);
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue