| | |
| | | } |
| | | } |
| | | |
| | | function onAfterSideNavLoaded() { |
| | | <?php |
| | | if($server_config_array['misc']['use_combobox'] == 'y'){ |
| | | ?> |
| | | $('#sidebar').find("select:not(.chosen-select)").select2({ |
| | | placeholder: '', |
| | | width: 'element', |
| | | selectOnBlur: true, |
| | | allowClear: true, |
| | | }); |
| | | <?php |
| | | } |
| | | ?> |
| | | |
| | | } |
| | | |
| | | function onAfterContentLoad(url, data) { |
| | | if(!data) data = ''; |
| | | else data = '&' + data; |
| | |
| | | ?> |
| | | |
| | | |
| | | $('#pageContent').find("select:not(.chosen-select)").combobox({ |
| | | select: function (event, ui) { |
| | | if (jQuery(".panel #Filter").length > 0) { |
| | | jQuery(".panel #Filter").trigger('click'); |
| | | $('#pageContent').find("select:not(.chosen-select)").select2({ |
| | | placeholder: '', |
| | | width: 'element', |
| | | selectOnBlur: true, |
| | | allowClear: true, |
| | | formatResult: function(o) { |
| | | if(o.id && $(o.element).parent().hasClass('flags')) return '<span class="flags flag-' + o.id.toLowerCase() + '">' + o.text + '</span>'; |
| | | else return o.text; |
| | | }, |
| | | formatSelection: function(o) { |
| | | if(o.id && $(o.element).parent().hasClass('flags')) return '<span class="flags flag-' + o.id.toLowerCase() + '">' + o.text + '</span>'; |
| | | else return o.text; |
| | | } |
| | | }).on('change', function(e) { |
| | | if (jQuery("#pageForm .table #Filter").length > 0) { |
| | | jQuery("#pageForm .table #Filter").trigger('click'); |
| | | } |
| | | } |
| | | }); |
| | | /* TODO: find a better way! */ |
| | | //$('.chosen-select').chosen({no_results_text: "<?php echo $wb['globalsearch_noresults_text_txt']; ?>", width: '300px'}); |
| | |
| | | success: function(data, textStatus, jqXHR) { |
| | | hideLoadIndicator(); |
| | | jQuery('#sidebar').html(jqXHR.responseText); |
| | | onAfterSideNavLoaded(); |
| | | loadPushyMenu(); |
| | | }, |
| | | error: function() { |
| | | hideLoadIndicator(); |
| | |
| | | success: function(data, textStatus, jqXHR) { |
| | | hideLoadIndicator(); |
| | | jQuery('#topnav-container').html(jqXHR.responseText); |
| | | loadPushyMenu(); |
| | | }, |
| | | error: function(o) { |
| | | hideLoadIndicator(); |
| | |
| | | return Math.floor(Math.random() * (max - min + 1)) + min; |
| | | } |
| | | |
| | | jQuery('.addPlaceholder').on("click", function(){ |
| | | jQuery(document).on("click", ".addPlaceholder", function(){ |
| | | var placeholderText = jQuery(this).text(); |
| | | var template = jQuery(this).siblings(':input'); |
| | | template.insertAtCaret(placeholderText); |
| | | }); |
| | | |
| | | jQuery('.addPlaceholderContent').on("click", function(){ |
| | | jQuery(document).on("click", ".addPlaceholderContent", function(){ |
| | | var placeholderContentText = jQuery(this).find('.addPlaceholderContent').text(); |
| | | var template2 = jQuery(this).siblings(':input'); |
| | | template2.insertAtCaret(placeholderContentText); |