/*! * jquery.sumoselect - v3.0.3 * http://hemantnegi.github.io/jquery.sumoselect * 2016-12-12 * * copyright 2015 hemant negi * email : hemant.frnz@gmail.com * compressor http://refresh-sf.com/ */ (function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports !== 'undefined') { module.exports = factory(require('jquery')); } else { factory(jquery); } })(function ($) { 'namespace sumo'; $.fn.sumoselect = function (options) { // this is the easiest way to have default options. var settings = $.extend({ placeholder: '', // dont change it here. csvdispcount: 3, // display no. of items in multiselect. 0 to display all. captionformat:'{0} selected', // format of caption text. you can set your locale. captionformatallselected:'{0} all selected!', // format of caption text when all elements are selected. set null to use captionformat. it will not work if there are disabled elements in select. floatwidth: 400, // screen width of device at which the list is rendered in floating popup fashion. forcecustomrendering: false, // force the custom modal on all devices below floatwidth resolution. nativeondevice: ['android', 'blackberry', 'iphone', 'ipad', 'ipod', 'opera mini', 'iemobile', 'silk'], // outputascsv: false, // true to post data as csv ( false for html control array ie. default select ) csvsepchar: ',', // separation char in csv mode okcancelinmulti: false, // display ok cancel buttons in desktop mode multiselect also. isclickawayok: false, // for okcancelinmulti=true. sets whether click outside will trigger ok or cancel (default is cancel). triggerchangecombined: true, // im multi select mode whether to trigger change event on individual selection or combined selection. selectall: false, // to display select all button in multiselect mode.|| also select all will not be available on mobile devices. search: true, // to display input for filtering content. selectalltext will be input text placeholder searchtext: '����', // placeholder for search input nomatch: 'û��������"{0}"', prefix: '', // some prefix usually the field name. eg. 'hello' locale: ['ok', 'cancel', 'select all'], // all text that is used. don't change the index. up: false, // set true to open upside. showtitle: true // set to false to prevent title (tooltip) from appearing }, options); var ret = this.each(function () { var selobj = this; // the original select object. if (this.sumo || !$(this).is('select')) return; //already initialized this.sumo = { e: $(selobj), //the jquery object of original select element. is_multi: $(selobj).attr('multiple'), //if its a multiple select select: '', caption: '', placeholder: '', optdiv: '', captioncont: '', ul:'', is_floating: false, is_opened: false, //backdrop: '', mob:false, // if to open device default select pstate: [], createelems: function () { var o = this; o.e.wrap('