Use select2 on touch devices

This is a relic from when select2 v3 had no mobile support, we use select2 v4 now that has been tested with mobile/touch devices.
Refs #108
Clean up some white spaces
This commit is contained in:
Samuel Georges 2016-10-17 08:38:01 +11:00
parent 571ceff1ef
commit d788b7e03f
4 changed files with 16 additions and 15 deletions

View File

@ -225,7 +225,7 @@
&.single-line {
ul {
li a span.title {
text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

View File

@ -81,7 +81,7 @@ if (window.jQuery === undefined)
data.push($.param(options.data))
var requestOptions = {
url : window.location.href,
url: window.location.href,
context: context,
headers: {
'X-OCTOBER-REQUEST-HANDLER': handler,

View File

@ -12,9 +12,6 @@
* Custom drop downs (Desktop only)
*/
$(document).render(function(){
if (Modernizr.touch)
return
var formatSelectOption = function(state) {
if (!state.id)
return state.text; // optgroup
@ -96,12 +93,18 @@
})
})
$(document).on('disable', 'select.custom-select', function(event, status){
$(this).select2('enable', !status)
$(document).on('disable', 'select.custom-select', function(event, status) {
if ($(this).data('select2') != null) {
$(this).select2('enable', !status)
}
})
$(document).on('focus', 'select.custom-select', function(event){
setTimeout($.proxy(function() { $(this).select2('focus') }, this), 10)
$(document).on('focus', 'select.custom-select', function(event) {
setTimeout($.proxy(function() {
if ($(this).data('select2') != null) {
$(this).select2('focus')
}
}, this), 10)
})
})(jQuery);
})(jQuery);

View File

@ -3155,9 +3155,7 @@ FilterWidget.prototype.initRegion=function(){this.locale=$('meta[name="backend-l
this.timezone=$('meta[name="backend-timezone"]').attr('content')
this.appTimezone=$('meta[name="app-timezone"]').attr('content')
if(!this.appTimezone){this.appTimezone='UTC'}
if(!this.timezone){this.timezone='UTC'}}}(window.jQuery);(function($){$(document).render(function(){if(Modernizr.touch)
return
var formatSelectOption=function(state){if(!state.id)
if(!this.timezone){this.timezone='UTC'}}}(window.jQuery);(function($){$(document).render(function(){var formatSelectOption=function(state){if(!state.id)
return state.text;var $option=$(state.element),iconClass=$option.data('icon'),imageSrc=$option.data('image')
if(iconClass)
return'<i class="select-icon '+iconClass+'"></i> '+state.text
@ -3181,8 +3179,8 @@ extraOptions.closeOnSelect=false
$element.on('select2:closing',function(){$('.select2-dropdown.select-no-dropdown:first .select2-results__option--highlighted').removeClass('select2-results__option--highlighted')
$('.select2-dropdown.select-no-dropdown:first .select2-results__option:first').addClass('select2-results__option--highlighted')})}}
$element.select2($.extend({},selectOptions,extraOptions))})})
$(document).on('disable','select.custom-select',function(event,status){$(this).select2('enable',!status)})
$(document).on('focus','select.custom-select',function(event){setTimeout($.proxy(function(){$(this).select2('focus')},this),10)})})(jQuery);+function($){"use strict";var LoadIndicator=function(element,options){var $el=this.$el=$(element)
$(document).on('disable','select.custom-select',function(event,status){if($(this).data('select2')!=null){$(this).select2('enable',!status)}})
$(document).on('focus','select.custom-select',function(event){setTimeout($.proxy(function(){if($(this).data('select2')!=null){$(this).select2('focus')}},this),10)})})(jQuery);+function($){"use strict";var LoadIndicator=function(element,options){var $el=this.$el=$(element)
this.options=options||{}
this.tally=0
this.show()}