drg_cms 0.6.1.4 → 0.6.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +203 -24
- data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
- data/app/assets/javascripts/drg_cms/drg_cms.js +229 -95
- data/app/assets/stylesheets/drg_cms/drg_cms.css +608 -542
- data/app/assets/stylesheets/drg_cms_application.css +1 -1
- data/app/assets/stylesheets/drg_cms_cms.css +1 -4
- data/app/controllers/cmsedit_controller.rb +54 -127
- data/app/controllers/dc_application_controller.rb +17 -2
- data/app/controllers/dc_common_controller.rb +13 -7
- data/app/controls/browse_models_control.rb +15 -26
- data/app/controls/cmsedit_control.rb +125 -0
- data/app/controls/dc_help_control.rb +13 -1
- data/app/controls/dc_page_control.rb +0 -1
- data/app/controls/dc_poll_result_control.rb +1 -1
- data/app/controls/dc_report.rb +1 -1
- data/app/controls/design_element_settings_control.rb +1 -1
- data/app/forms/all_options.yml +23 -7
- data/app/forms/cms_menu.yml +24 -24
- data/app/forms/dc_big_table.yml +0 -2
- data/app/forms/dc_big_table_value.yml +0 -2
- data/app/forms/dc_browse_fields.yml +13 -9
- data/app/forms/dc_design.yml +1 -2
- data/app/forms/dc_folder_permission.yml +0 -2
- data/app/forms/dc_help_1.yml +2 -1
- data/app/forms/dc_json_ld.yml +0 -3
- data/app/forms/dc_menu.yml +6 -12
- data/app/forms/dc_menu_item.yml +1 -3
- data/app/forms/dc_page.yml +1 -2
- data/app/forms/dc_policy.yml +2 -5
- data/app/forms/dc_poll.yml +10 -16
- data/app/forms/dc_poll_result_export.yml +1 -1
- data/app/forms/dc_seo.yml +1 -2
- data/app/forms/dc_simple_menu.yml +1 -2
- data/app/forms/dc_site.yml +5 -7
- data/app/helpers/cms_common_helper.rb +8 -6
- data/app/helpers/cms_edit_helper.rb +61 -53
- data/app/helpers/cms_helper.rb +78 -42
- data/app/helpers/cms_index_helper.rb +198 -137
- data/app/helpers/dc_application_helper.rb +65 -43
- data/app/models/concerns/dc_page_concern.rb +1 -1
- data/app/models/concerns/dc_site_concern.rb +9 -3
- data/app/models/dc_big_table.rb +2 -2
- data/app/models/dc_filter.rb +45 -37
- data/app/models/dc_json_ld.rb +1 -1
- data/app/models/dc_part.rb +19 -9
- data/app/models/dc_site.rb +0 -1
- data/app/models/dc_temp.rb +7 -0
- data/app/models/drgcms_form_fields/comment.rb +11 -2
- data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
- data/app/models/drgcms_form_fields/link_to.rb +1 -1
- data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
- data/app/models/drgcms_form_fields/readonly.rb +3 -0
- data/app/models/drgcms_form_fields/select.rb +14 -14
- data/app/models/drgcms_form_fields/text_autocomplete.rb +19 -11
- data/app/renderers/dc_part_renderer.rb +1 -1
- data/app/renderers/dc_poll_renderer.rb +1 -1
- data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
- data/app/views/cmsedit/_form.html.erb +3 -2
- data/app/views/cmsedit/_result.html.erb +21 -18
- data/app/views/cmsedit/login.html.erb +1 -1
- data/app/views/dc_common/paste_clipboard.html.erb +1 -1
- data/app/views/layouts/cms.html.erb +3 -5
- data/config/locales/drgcms_en.yml +5 -3
- data/config/locales/drgcms_sl.yml +5 -3
- data/config/locales/kaminari.yml +1 -1
- data/config/locales/models_sl.yml +1 -0
- data/drg_cms.gemspec +1 -1
- data/lib/drg_cms/version.rb +1 -1
- data/lib/drg_cms.rb +6 -12
- metadata +10 -5
- data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
- data/app/views/cmsedit/__show.html.erb +0 -21
@@ -159,7 +159,7 @@ $(function() {
|
|
159
159
|
* record_name: will replace value of record[name] field on a form with supplied value
|
160
160
|
*
|
161
161
|
* msg_error: will display error message.
|
162
|
-
*
|
162
|
+
* msg_warning: will display warning message.
|
163
163
|
* msg_info: will display informational message.
|
164
164
|
*
|
165
165
|
* popup: will display popup message
|
@@ -207,7 +207,7 @@ process_json_result = function(json) {
|
|
207
207
|
// select field
|
208
208
|
} else if (field.is('select')) {
|
209
209
|
// options for select field
|
210
|
-
if (
|
210
|
+
if (Array.isArray(value)) {
|
211
211
|
field.empty();
|
212
212
|
$.each(value, function(index, v) {
|
213
213
|
field.append( new Option(v[0], v[1]) );
|
@@ -245,9 +245,20 @@ process_json_result = function(json) {
|
|
245
245
|
|
246
246
|
/**** display popup message ****/
|
247
247
|
case 'popup':
|
248
|
-
|
249
|
-
|
250
|
-
|
248
|
+
if (selector == 'url') {
|
249
|
+
$('#popup').bPopup({ loadUrl: value,
|
250
|
+
transition: 'slideDown', transitionClose: 'slideDown', speed: 300,
|
251
|
+
opacity: 0, position: ['auto', 20],
|
252
|
+
closeClass: 'dc-link' });
|
253
|
+
}
|
254
|
+
else {
|
255
|
+
$('#popup').html(value);
|
256
|
+
$('#popup').bPopup( {
|
257
|
+
transition: 'slideDown', transitionClose: 'slideDown', speed: 300,
|
258
|
+
opacity: 0, position: ['auto', 20],
|
259
|
+
closeClass: 'dc-link' });
|
260
|
+
}
|
261
|
+
break;
|
251
262
|
|
252
263
|
/**** update div ****/
|
253
264
|
case '#div+':
|
@@ -273,6 +284,9 @@ process_json_result = function(json) {
|
|
273
284
|
case 'url':
|
274
285
|
window.location.href = value;
|
275
286
|
break;
|
287
|
+
case 'parenturl':
|
288
|
+
parent.location.href = value;
|
289
|
+
break;
|
276
290
|
case 'alert':
|
277
291
|
alert(value);
|
278
292
|
break;
|
@@ -326,10 +340,12 @@ function dc_reload_window() {
|
|
326
340
|
/*******************************************************************
|
327
341
|
* Will open popup window
|
328
342
|
*******************************************************************/
|
329
|
-
function popup_window(url,
|
330
|
-
let y =
|
331
|
-
let x =
|
332
|
-
|
343
|
+
function popup_window(url, title, parent_win, w, h) {
|
344
|
+
let y = parent_win.top.outerHeight / 2 + parent_win.top.screenY - (h / 2);
|
345
|
+
let x = parent_win.top.outerWidth / 2 + parent_win.top.screenX - (w / 2);
|
346
|
+
let win = parent_win.open(url, 'dc_popup', `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=${w}, height=${h}, top=${y}, left=${x}`);
|
347
|
+
win.document.title = title;
|
348
|
+
return win;
|
333
349
|
}
|
334
350
|
|
335
351
|
/*******************************************************************
|
@@ -385,7 +401,7 @@ process_parent_form_updates = function(element) {
|
|
385
401
|
/*****************************************************************
|
386
402
|
* Toggle show and hide div
|
387
403
|
******************************************************************/
|
388
|
-
|
404
|
+
dc_div_toggle = function(div) {
|
389
405
|
if ($(div).is(":visible")) {
|
390
406
|
$(div).slideUp();
|
391
407
|
} else {
|
@@ -393,8 +409,55 @@ dc_toggle_div = function(div) {
|
|
393
409
|
}
|
394
410
|
};
|
395
411
|
|
412
|
+
/*****************************************************************
|
413
|
+
* Process simple ajax call
|
414
|
+
******************************************************************/
|
415
|
+
simple_ajax_call = function(url) {
|
416
|
+
$.ajax({
|
417
|
+
url: url,
|
418
|
+
success: function(data) { process_json_result(data); }
|
419
|
+
});
|
420
|
+
};
|
421
|
+
|
422
|
+
/*****************************************************************
|
423
|
+
* Return value of the input field on a form
|
424
|
+
******************************************************************/
|
425
|
+
function dc_field_get_value(field_name) {
|
426
|
+
field_name = field_name.replace('record_', '');
|
427
|
+
let field = $('[name="record[' + field_name + ']"]');
|
428
|
+
return field.val();
|
429
|
+
}
|
430
|
+
|
431
|
+
/*****************************************************************
|
432
|
+
* Will process data-fields attribute and add field values as parameters to url
|
433
|
+
******************************************************************/
|
434
|
+
function dc_url_add_params(form, url) {
|
435
|
+
// check if data-fields attribute present
|
436
|
+
let fields = form.getAttribute("data-fields");
|
437
|
+
if (fields === null) return url;
|
438
|
+
// url might already contain ?
|
439
|
+
let form_parms = '?';
|
440
|
+
if (url.match(/\?/)) form_parms = '';
|
441
|
+
|
442
|
+
fields.split(',').forEach( function(field) {
|
443
|
+
let value = dc_field_get_value(field);
|
444
|
+
if (value) form_parms += '&' + field + '=' + value;
|
445
|
+
});
|
446
|
+
return url + form_parms;
|
447
|
+
}
|
448
|
+
|
396
449
|
/*******************************************************************
|
397
|
-
*
|
450
|
+
* Copy div text to clipboard
|
451
|
+
*******************************************************************/
|
452
|
+
function dc_copy_to_clipboard(div) {
|
453
|
+
let copyText = document.getElementById(div).innerText;
|
454
|
+
console.log(copyText);
|
455
|
+
/* Copy the text inside the text field */
|
456
|
+
navigator.clipboard.writeText(copyText);
|
457
|
+
}
|
458
|
+
|
459
|
+
/*******************************************************************
|
460
|
+
* Events start here
|
398
461
|
*******************************************************************/
|
399
462
|
$(document).ready( function() {
|
400
463
|
/* This could be the way to focus on first input field on document open
|
@@ -457,7 +520,7 @@ $(document).ready( function() {
|
|
457
520
|
* Popup CMS edit menu option clicked
|
458
521
|
*******************************************************************/
|
459
522
|
$('.drgcms_popmenu_item').on('click',function(e) {
|
460
|
-
url = e.target.getAttribute("data-url");
|
523
|
+
let url = e.target.getAttribute("data-url");
|
461
524
|
$('#iframe_cms').attr('src', url);
|
462
525
|
// $('#iframe_cms').width(1000).height(1000);
|
463
526
|
// scroll to top of page and hide menu
|
@@ -468,13 +531,22 @@ $(document).ready( function() {
|
|
468
531
|
/*******************************************************************
|
469
532
|
* Sort action clicked on cmsedit
|
470
533
|
*******************************************************************/
|
471
|
-
$('.
|
534
|
+
$('.dc-sort-select').change( function(e) {
|
472
535
|
let table = e.target.getAttribute("data-table");
|
473
536
|
let form = e.target.getAttribute("data-form");
|
474
537
|
if (form === null) form = table;
|
475
538
|
let sort = e.target.value;
|
476
|
-
e.target.value = null;
|
477
|
-
|
539
|
+
// e.target.value = null;
|
540
|
+
let url = "/cmsedit/run?control=cmsedit.sort&sort=" + sort + "&table=" + table + "&form_name=" + form;
|
541
|
+
simple_ajax_call(url);
|
542
|
+
});
|
543
|
+
|
544
|
+
/*******************************************************************
|
545
|
+
* Click on field name in result header perform sort action
|
546
|
+
*******************************************************************/
|
547
|
+
$('.dc-result-header span').on('click',function(e) {
|
548
|
+
let url = e.target.getAttribute("data-url");
|
549
|
+
simple_ajax_call(url);
|
478
550
|
});
|
479
551
|
|
480
552
|
/*******************************************************************
|
@@ -574,7 +646,7 @@ $(document).ready( function() {
|
|
574
646
|
$('.iframe_embedded').on('load', function() {
|
575
647
|
let embedded_height = this.contentWindow.document.body.offsetHeight;
|
576
648
|
// workaround. It gets tricky when embedded field is on tab
|
577
|
-
if (embedded_height == 0) embedded_height =
|
649
|
+
if (embedded_height == 0) embedded_height = 50;
|
578
650
|
this.style.height = (embedded_height + 30) + 'px';
|
579
651
|
// resize parent iframe window too
|
580
652
|
let parentWindow = this.contentWindow.parent;
|
@@ -634,9 +706,21 @@ $(document).ready( function() {
|
|
634
706
|
success: function(data) {
|
635
707
|
process_json_result(data);
|
636
708
|
$('.dc-spinner').hide();
|
709
|
+
},
|
710
|
+
error: function (request, status, error) {
|
711
|
+
$('.dc-spinner').css('color','red');
|
712
|
+
alert(request.responseText);
|
637
713
|
}
|
638
714
|
});
|
639
715
|
});
|
716
|
+
|
717
|
+
/*******************************************************************
|
718
|
+
* Click on filter off
|
719
|
+
*******************************************************************/
|
720
|
+
$('.mi-search_off').on('click', function(e) {
|
721
|
+
let url = $(this).parents('.dc-filter').attr("data-url");
|
722
|
+
if (url.length > 5) simple_ajax_call(url);
|
723
|
+
});
|
640
724
|
|
641
725
|
/*******************************************************************
|
642
726
|
* Process action submit button click.
|
@@ -657,24 +741,44 @@ $(document).ready( function() {
|
|
657
741
|
form.setAttribute('action', url);
|
658
742
|
form.setAttribute('method', "post");
|
659
743
|
form.submit();
|
660
|
-
});
|
661
|
-
|
662
|
-
/*******************************************************************
|
663
|
-
|
664
|
-
********************************************************************/
|
665
|
-
$('.dc-window-open').on('click', function(e) {
|
666
|
-
|
667
|
-
if (confirmation_is_cancled(this))
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
744
|
+
});
|
745
|
+
|
746
|
+
/*******************************************************************
|
747
|
+
Will open a new window with URL specified.
|
748
|
+
********************************************************************/
|
749
|
+
$('.dc-window-open').on('click', function(e) {
|
750
|
+
// confirmation if required
|
751
|
+
if (confirmation_is_cancled(this)) return false;
|
752
|
+
|
753
|
+
let url = this.getAttribute("data-url");
|
754
|
+
let title = this.getAttribute("title");
|
755
|
+
let w = this.getAttribute("data-x") || 1000;
|
756
|
+
let h = this.getAttribute("data-y") || 800;
|
757
|
+
|
758
|
+
url = dc_url_add_params(this, url)
|
759
|
+
let win = popup_window(url, title, window, w, h);
|
676
760
|
win.focus();
|
677
|
-
});
|
761
|
+
});
|
762
|
+
|
763
|
+
/*******************************************************************
|
764
|
+
Will open a new popup with URL specified.
|
765
|
+
********************************************************************/
|
766
|
+
$('.dc-popup-open').on('click', function(e) {
|
767
|
+
// confirmation if required
|
768
|
+
if (confirmation_is_cancled(this)) return false;
|
769
|
+
|
770
|
+
let url = this.getAttribute("data-url");
|
771
|
+
let title = this.getAttribute("title");
|
772
|
+
let w = this.getAttribute("data-x") || 1000;
|
773
|
+
let h = this.getAttribute("data-y") || 800;
|
774
|
+
|
775
|
+
url = dc_url_add_params(this, url)
|
776
|
+
$('#popup').bPopup({ loadUrl: url,
|
777
|
+
transition: 'slideDown', transitionClose: 'slideDown', speed: 300,
|
778
|
+
opacity: 0, position: ['auto', 20],
|
779
|
+
closeClass: 'dc-link'
|
780
|
+
});
|
781
|
+
});
|
678
782
|
|
679
783
|
/*******************************************************************
|
680
784
|
* Animate button on click
|
@@ -690,20 +794,7 @@ $(document).ready( function() {
|
|
690
794
|
$(this).toggleClass('dc-animate-button');
|
691
795
|
});
|
692
796
|
*/
|
693
|
-
|
694
|
-
* Animate button on click
|
695
|
-
*******************************************************************/
|
696
|
-
$('.dc-animate').mousedown( function() {
|
697
|
-
$(this).toggleClass('dc-animate-button');
|
698
|
-
});
|
699
|
-
|
700
|
-
/*******************************************************************
|
701
|
-
* Animate button on click
|
702
|
-
*******************************************************************/
|
703
|
-
$('.dc-animate').mouseup( function() {
|
704
|
-
$(this).toggleClass('dc-animate-button');
|
705
|
-
});
|
706
|
-
|
797
|
+
|
707
798
|
/*******************************************************************
|
708
799
|
* App menu option clicked
|
709
800
|
*******************************************************************/
|
@@ -724,28 +815,40 @@ $(document).ready( function() {
|
|
724
815
|
/*******************************************************************
|
725
816
|
* Display spinner on link with spinner, submit link
|
726
817
|
*******************************************************************/
|
727
|
-
$('.dc-link
|
818
|
+
$('.dc-link.spin').on('click', function(e) {
|
728
819
|
$('.dc-spinner').show();
|
729
820
|
});
|
730
821
|
|
731
822
|
$('.dc-link-submit').on('click', function(e) {
|
732
823
|
$('.dc-spinner').show();
|
733
|
-
});
|
824
|
+
});
|
825
|
+
|
826
|
+
/*******************************************************************
|
827
|
+
* Hide spinner when validation error occured
|
828
|
+
*******************************************************************/
|
829
|
+
$(':input').on("invalid", function(event) {
|
830
|
+
$('.dc-spinner').hide();
|
831
|
+
});
|
734
832
|
|
735
833
|
/*******************************************************************
|
736
834
|
* Add button clicked while in edit. Create window dialog for adding new record
|
737
835
|
* into required table. This is helper scenario, when user is selecting
|
738
836
|
* data from with text_autocomplete and data doesn't exist in belongs_to table.
|
739
837
|
*******************************************************************/
|
740
|
-
$('.in-edit-add').on('click', function(e) {
|
741
|
-
let
|
838
|
+
$('.in-edit-add').on('click', function(e) {
|
839
|
+
let id = this.getAttribute("data-id");
|
840
|
+
let table = this.getAttribute("data-table");
|
841
|
+
let url = '/cmsedit/new?window_close=0&table=' + table;
|
842
|
+
if (id) {
|
843
|
+
url = '/cmsedit/' + id + '/edit?window_close=0&table=' + table;
|
844
|
+
}
|
742
845
|
let w = popup_window(url, '', window, 1000, 800);
|
743
846
|
w.focus();
|
744
847
|
});
|
745
848
|
|
746
849
|
/**********************************************************************
|
747
850
|
* When filter_field (field name) is selected on filter subform this routine finds
|
748
|
-
* and displays
|
851
|
+
* and displays appropriate span with input field.
|
749
852
|
**********************************************************************/
|
750
853
|
$('#filter_field').on('change', function() {
|
751
854
|
if (this.value.length > 0) {
|
@@ -883,11 +986,10 @@ $(document).ready( function() {
|
|
883
986
|
*******************************************************************/
|
884
987
|
$('#_record__filter_field').keydown( function(e) {
|
885
988
|
if (e.which == '13' || e.which == '9') {
|
886
|
-
|
989
|
+
let url = $(this).parents('span').attr("data-url");
|
887
990
|
url = url + "&filter_value=" + this.value;
|
888
|
-
|
889
|
-
|
890
|
-
}
|
991
|
+
simple_ajax_call(url);
|
992
|
+
};
|
891
993
|
});
|
892
994
|
|
893
995
|
/*******************************************************************
|
@@ -905,7 +1007,7 @@ $(document).ready( function() {
|
|
905
1007
|
value = field.val();
|
906
1008
|
}
|
907
1009
|
url = url + "&filter_value=" + value;
|
908
|
-
|
1010
|
+
simple_ajax_call(url);
|
909
1011
|
});
|
910
1012
|
|
911
1013
|
/*******************************************************************
|
@@ -913,47 +1015,77 @@ $(document).ready( function() {
|
|
913
1015
|
*******************************************************************/
|
914
1016
|
$('#open_drgcms_filter').on('click', function(e) {
|
915
1017
|
$('#drgcms_filter').bPopup({
|
916
|
-
speed:
|
917
|
-
|
918
|
-
|
1018
|
+
transition: 'slideDown', transitionClose: 'slideDown', speed: 300,
|
1019
|
+
opacity: 0, position: ['auto', 20],
|
1020
|
+
closeClass: 'dc-link' });
|
919
1021
|
});
|
920
1022
|
|
921
1023
|
/*******************************************************************
|
922
1024
|
* Click on preview selected image
|
923
1025
|
*******************************************************************/
|
924
1026
|
$('.dc-image-preview').on('click', function(e) {
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
1027
|
+
let img = $(this).children(":first").attr('src');
|
1028
|
+
$('#dc-image-preview').bPopup({
|
1029
|
+
content: 'image', //'ajax', 'iframe' or 'image'
|
1030
|
+
contentContainer: '#dc-image-preview',
|
1031
|
+
loadUrl: img,
|
1032
|
+
opacity: 0
|
1033
|
+
});
|
932
1034
|
});
|
933
1035
|
|
934
1036
|
/*******************************************************************
|
935
|
-
*
|
1037
|
+
* Set new filter
|
936
1038
|
*******************************************************************/
|
937
|
-
$('.
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
// Still opening in new window
|
944
|
-
// iframe = parent.document.getElementsByTagName("iframe")[0].getAttribute("id");
|
945
|
-
// loc = url + '&filter_field=' + field + '&filter_oper=' + oper
|
946
|
-
// $('#'+iframe).attr('src', loc);
|
947
|
-
// parent.document.getElementById(iframe).src = loc
|
1039
|
+
$('.dc-filter-set').on('click', function(e) {
|
1040
|
+
let url = $(this).attr( 'data-url' );
|
1041
|
+
let field = $('select#filter_field1').val();
|
1042
|
+
let operation = $('select#filter_oper').val();
|
1043
|
+
url = url + '&filter_field=' + field + '&filter_oper=' + operation
|
1044
|
+
simple_ajax_call(url);
|
948
1045
|
});
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
1046
|
+
|
1047
|
+
/*******************************************************************
|
1048
|
+
* Toggle one cmsedit menu level
|
1049
|
+
*******************************************************************/
|
1050
|
+
$('.cmsedit-top-level-menu div').on('click', function(e) {
|
1051
|
+
$(e.target).siblings('ul').toggle('fast');
|
1052
|
+
$(e.target).toggleClass('expanded');
|
1053
|
+
});
|
1054
|
+
|
1055
|
+
/*******************************************************************
|
1056
|
+
* Toggle result set record menu
|
1057
|
+
*
|
1058
|
+
* This and additional two event hadlers provide expected behavior of submenus popup and close.
|
1059
|
+
*******************************************************************/
|
1060
|
+
$('.dc-result-submenu .mi-more_vert').on('click', function(e) {
|
1061
|
+
let ul = $(e.target).siblings('ul');
|
1062
|
+
// hide last selected menu if not the same
|
1063
|
+
if (typeof dc_last_menu_selected !== 'undefined') { dc_last_menu_selected.hide(); }
|
1064
|
+
// if menu is past the bottom fix it to bottom
|
1065
|
+
let menu_bottom = ul.height() + ul.parent().position().top + 20;
|
1066
|
+
if (menu_bottom > $(document).height()) ul.css('bottom', 0);
|
1067
|
+
ul.show();
|
1068
|
+
dc_last_menu_selected = ul;
|
955
1069
|
});
|
956
|
-
|
1070
|
+
|
1071
|
+
/*******************************************************************
|
1072
|
+
* Result record menu has lost focus. Hide menu.
|
1073
|
+
*******************************************************************/
|
1074
|
+
$('.dc-result-submenu ul').hover(function(e) {
|
1075
|
+
},
|
1076
|
+
function(e) {
|
1077
|
+
dc_last_menu_selected.hide();
|
1078
|
+
dc_last_menu_selected = undefined;
|
1079
|
+
});
|
1080
|
+
|
1081
|
+
/*******************************************************************
|
1082
|
+
* Result set record menu is left open if action is canceled. Ex. delete confirm. This will hide menu.
|
1083
|
+
*******************************************************************/
|
1084
|
+
$('.dc-result-submenu ul li').on('click', function(e) {
|
1085
|
+
console.log('ups');
|
1086
|
+
if (typeof dc_last_menu_selected !== 'undefined') dc_last_menu_selected.hide();
|
1087
|
+
});
|
1088
|
+
|
957
1089
|
/*******************************************************************
|
958
1090
|
* Resize result table columns. For now an idea.
|
959
1091
|
*******************************************************************/
|
@@ -1085,14 +1217,14 @@ $(document).ready( function() {
|
|
1085
1217
|
*******************************************************************/
|
1086
1218
|
$('.dc-result-header .th i').hover( function() {
|
1087
1219
|
old_sort_icon = '';
|
1088
|
-
// save old sort icon and replace it with filter icon
|
1220
|
+
// save old sort icon and replace it with filter icon
|
1089
1221
|
$.each( $(this).attr("class").split(/\s+/),
|
1090
1222
|
function(index, item) { if (item.match('sort')) { old_sort_icon = item}; }
|
1091
1223
|
);
|
1092
|
-
$(this).removeClass(old_sort_icon).addClass('
|
1093
|
-
// bring back old sort icon
|
1094
|
-
}, function(){
|
1095
|
-
$(this).removeClass('
|
1224
|
+
$(this).removeClass(old_sort_icon).addClass('mi-ads_click');
|
1225
|
+
// bring back old sort icon
|
1226
|
+
}, function() {
|
1227
|
+
$(this).removeClass('mi-ads_click').addClass(old_sort_icon);
|
1096
1228
|
});
|
1097
1229
|
|
1098
1230
|
/*******************************************************************
|
@@ -1100,6 +1232,8 @@ $(document).ready( function() {
|
|
1100
1232
|
*******************************************************************/
|
1101
1233
|
$('.dc-result-header .th i').click( function(e) {
|
1102
1234
|
e.preventDefault();
|
1235
|
+
if ($(this).hasClass('no-filter')) return;
|
1236
|
+
|
1103
1237
|
// additional click will close dialog when visible
|
1104
1238
|
if ($('.filter-popup').is(':visible')) {
|
1105
1239
|
$('.filter-popup').hide();
|
@@ -1110,7 +1244,7 @@ $(document).ready( function() {
|
|
1110
1244
|
let field_name = header.attr("data-name");
|
1111
1245
|
$('.filter-popup').attr('data-name', field_name);
|
1112
1246
|
// change popup position and show
|
1113
|
-
$('.filter-popup').css({'top':e.pageY+5,'left':e.pageX, 'position':'absolute'});
|
1247
|
+
$('.filter-popup').css({'top': e.pageY + 5, 'left': e.pageX, 'position': 'absolute'});
|
1114
1248
|
$('.filter-popup').show();
|
1115
1249
|
});
|
1116
1250
|
|
@@ -1125,7 +1259,7 @@ $(document).ready( function() {
|
|
1125
1259
|
let field_name = parent.data("name");
|
1126
1260
|
|
1127
1261
|
url = url + '&filter_field=' + field_name + '&filter_oper=' + operator;
|
1128
|
-
|
1262
|
+
simple_ajax_call(url);
|
1129
1263
|
});
|
1130
1264
|
|
1131
1265
|
/*****************************************************************
|
@@ -1133,14 +1267,14 @@ $(document).ready( function() {
|
|
1133
1267
|
******************************************************************/
|
1134
1268
|
$(".dc-handle").click(function() {
|
1135
1269
|
let div = this.getAttribute("data-div");
|
1136
|
-
|
1270
|
+
dc_div_toggle(div);
|
1137
1271
|
});
|
1138
1272
|
|
1139
1273
|
/*******************************************************************
|
1140
1274
|
* Show-Hide CMS menu on hamburger click
|
1141
1275
|
*******************************************************************/
|
1142
1276
|
$('#menu-hamburger').on('click', function(e) {
|
1143
|
-
$('.cmsedit-container #menu').toggleClass('visible');
|
1277
|
+
$('.cmsedit-container #cms-menu').toggleClass('visible');
|
1144
1278
|
});
|
1145
1279
|
|
1146
1280
|
});
|