You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
23 KiB
11 lines
23 KiB
/*!
|
|
* # Semantic UI 1.11.4 - Dropdown
|
|
* http://github.com/semantic-org/semantic-ui/
|
|
*
|
|
*
|
|
* Copyright 2014 Contributors
|
|
* Released under the MIT license
|
|
* http://opensource.org/licenses/MIT
|
|
*
|
|
*/
|
|
!function(e,t,n,i){"use strict";e.fn.dropdown=function(o){var a,r=e(this),s=e(n),l=r.selector||"",c="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],f=arguments[0],v="string"==typeof f,h=[].slice.call(arguments,1);return r.each(function(){var m,g,p,b,w,y=e.isPlainObject(o)?e.extend(!0,{},e.fn.dropdown.settings,o):e.extend({},e.fn.dropdown.settings),x=y.className,T=y.metadata,C=y.namespace,S=y.selector,k=y.error,A="."+C,I="module-"+C,E=e(this),D=E.find(S.text),F=E.find(S.search),M=E.find(S.labels),q=E.find(S.input),O=E.prev().find(S.text).length>0?E.prev().find(S.text):E.prev(),V=E.children(S.menu),z=V.find(S.item),Q=!1,R=!1,P=this,H=E.data(I);w={initialize:function(){w.debug("Initializing dropdown",y),w.is.alreadySetup()?w.setup.reference():(w.setup.layout(),w.save.defaults(),w.set.selected(),w.create.id(),c&&w.bind.touchEvents(),w.bind.mouseEvents(),w.bind.keyboardEvents(),w.observeChanges(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of dropdown",w),H=w,E.data(I,w)},destroy:function(){w.verbose("Destroying previous dropdown for",E),w.remove.tabbable(),E.off(A).removeData(I),V.off(A),s.off(m),p&&p.disconnect(),b&&b.disconnect()},observeChanges:function(){"MutationObserver"in t&&(p=new MutationObserver(function(){w.debug("<select> modified, recreating menu"),w.setup.select()}),b=new MutationObserver(function(){w.debug("Menu modified, updating selector cache"),w.refresh()}),w.has.input()&&p.observe(q[0],{childList:!0,subtree:!0}),w.has.menu()&&b.observe(V[0],{childList:!0,subtree:!0}),w.debug("Setting up mutation observer",p,b))},create:{id:function(){g=(Math.random().toString(16)+"000000000").substr(2,8),m="."+g,w.verbose("Creating unique id for element",g)}},search:function(){var e;e=F.val(),w.verbose("Searching for query",e),w.filter(e),w.is.searchSelection()&&w.can.show()&&w.show()},setup:{layout:function(){E.is("select")&&w.setup.select(),w.is.search()&&!w.has.search()&&(F=e("<input />").addClass(x.search).insertBefore(D)),w.is.multiple()&&!w.has.labels()&&(M=e("<div />").addClass(x.labels).insertBefore(F)),y.allowTab&&w.set.tabbable()},select:function(){var t=w.get.selectValues();w.debug("Dropdown initialized on a select",t),E.is("select")&&(q=E),q.parent(S.dropdown).length>0?(w.debug("UI dropdown already exists. Creating dropdown menu only"),E=q.closest(S.dropdown),V=E.children(S.menu),0===V.length&&(V=e("<div />").addClass(x.menu).appendTo(E)),V.html(y.templates.menu(t))):(w.debug("Creating entire dropdown from select"),E=e("<div />").attr("class",q.attr("class")).addClass(x.selection).addClass(x.dropdown).html(y.templates.dropdown(t)).insertBefore(q),q.removeAttr("class").prependTo(E)),q.is("[multiple]")&&w.set.multiple(),w.refresh()},reference:function(){var e,t,n=r.index(E);w.debug("Dropdown behavior was called on select, replacing with closest dropdown"),E=E.parent(S.dropdown),w.refresh(),e=r.slice(0,n),t=r.slice(n+1),r=e.add(E).add(t)}},refresh:function(){w.verbose("Refreshing selector cache"),D=E.find(S.text),F=E.find(S.search),q=E.find(S.input),O=E.prev().find(S.text).length>0?E.prev().find(S.text):E.prev(),V=E.children(S.menu),z=V.find(S.item),M=E.find(S.labels)},toggle:function(){w.verbose("Toggling menu visibility"),w.is.active()?w.hide():w.show()},show:function(t){t=e.isFunction(t)?t:function(){},w.is.searchSelection()&&w.is.allFiltered()||w.can.show()&&!w.is.active()&&(w.debug("Showing dropdown"),w.animate.show(function(){w.can.click()&&w.bind.intent(),w.set.visible(),t.call(P)}),y.onShow.call(P))},hide:function(t){t=e.isFunction(t)?t:function(){},w.is.active()&&(w.debug("Hiding dropdown"),w.animate.hide(function(){w.remove.visible(),t.call(P)}),y.onHide.call(P))},hideOthers:function(){w.verbose("Finding other dropdowns to hide"),r.not(E).has(S.menu+":visible:not(."+x.animating+")").dropdown("hide")},hideSubMenus:function(){var e=V.find(S.menu);e.transition("hide")},bind:{keyboardEvents:function(){w.debug("Binding keyboard events"),E.on("keydown"+A,w.event.keydown),w.has.search()&&E.on(w.get.inputEvent(),S.search,w.event.input)},touchEvents:function(){w.debug("Touch device detected binding additional touch events"),w.is.searchSelection()||E.on("touchstart"+A,w.event.test.toggle),V.on("touchstart"+A,S.item,w.event.item.mouseenter)},mouseEvents:function(){w.verbose("Mouse detected binding mouse events"),w.is.searchSelection()?E.on("mousedown"+A,S.menu,w.event.menu.activate).on("mouseup"+A,S.menu,w.event.menu.deactivate).on("click"+A,S.search,w.show).on("focus"+A,S.search,w.event.searchFocus).on("blur"+A,S.search,w.event.searchBlur).on("click"+A,S.text,w.event.searchTextFocus):("click"==y.on?E.on("click"+A,w.event.test.toggle):"hover"==y.on?E.on("mouseenter"+A,w.delay.show).on("mouseleave"+A,w.delay.hide):E.on(y.on+A,w.toggle),E.on("mousedown"+A,w.event.mousedown).on("mouseup"+A,w.event.mouseup).on("focus"+A,w.event.focus).on("blur"+A,w.event.blur)),V.on("mouseenter"+A,S.item,w.event.item.mouseenter).on("mouseleave"+A,S.item,w.event.item.mouseleave).on("click"+A,S.item,w.event.item.click)},intent:function(){w.verbose("Binding hide intent event to document"),c&&s.on("touchstart"+m,w.event.test.touch).on("touchmove"+m,w.event.test.touch),s.on("click"+m,w.event.test.hide)}},unbind:{intent:function(){w.verbose("Removing hide intent event from document"),c&&s.off("touchstart"+m).off("touchmove"+m),s.off("click"+m)}},filter:function(t){var n=e(),i=w.escape.regExp(t),o=new RegExp("^"+i,"igm"),a=new RegExp(i,"ig");w.verbose("Searching for matching values"),z.each(function(){var t=e(this),i=String(w.get.choiceText(t,!1)),r=String(w.get.choiceValue(t,i));i.match(o)||r.match(o)?n=n.add(t):y.fullTextSearch&&(i.match(a)||r.match(a))&&(n=n.add(t))}),w.debug("Setting filter",t),w.remove.filteredItem(),z.not(n).addClass(x.filtered),w.verbose("Selecting first non-filtered element"),w.remove.selectedItem(),z.not("."+x.filtered).eq(0).addClass(x.selected),w.is.allFiltered()&&(w.debug("All items filtered, hiding dropdown",t),w.is.searchSelection()&&w.hide(),y.onNoResults.call(P,t))},focusSearch:function(){w.is.search()&&F.focus()},forceSelection:function(){var e=z.not(x.filtered).filter("."+x.selected).eq(0),t=z.filter("."+x.active).eq(0),n=e.length>0?e:t,i=n.size()>0;i?(w.event.item.click.call(n),w.remove.filteredItem()):w.hide()},event:{mousedown:function(){Q=!0},mouseup:function(){Q=!1},focus:function(){!Q&&w.is.hidden()&&w.show()},blur:function(){var e=n.activeElement===this;Q||e||w.hide()},searchFocus:function(){Q=!0,w.show()},searchBlur:function(){var e=n.activeElement===this;R||e||(y.forceSelection?w.forceSelection():w.hide())},searchTextFocus:function(){Q=!0,F.focus()},input:function(){w.is.searchSelection()&&w.set.filtered(),clearTimeout(w.timer),w.timer=setTimeout(w.search,y.delay.search)},keydown:function(e){{var t,n=z.not(x.filtered).filter("."+x.selected).eq(0),i=V.children("."+x.active).eq(0),o=n.length>0?n:i,a=o.length>0?o.siblings(":not(."+x.filtered+")").andSelf():V.children(":not(."+x.filtered+")"),r=o.children(S.menu),s=o.closest(S.menu),l=s[0]!==V[0],c=s.is(":visible"),u=e.which,d={enter:13,escape:27,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},f=r.length>0,v=o.length>0;a.size()-1}if(w.is.visible()){if(u==d.enter&&v&&(f&&!y.allowCategorySelection?(w.verbose("Pressed enter on unselectable category, opening sub menu"),u=d.rightArrow):(w.verbose("Enter key pressed, choosing selected item"),w.event.item.click.call(o,e))),u==d.leftArrow&&(l&&(w.verbose("Left key pressed, closing sub-menu"),w.animate.hide(!1,s),o.removeClass(x.selected),s.closest(S.item).addClass(x.selected)),e.preventDefault()),u==d.rightArrow&&(f&&(w.verbose("Right key pressed, opening sub-menu"),w.animate.show(!1,r),o.removeClass(x.selected),r.find(S.item).eq(0).addClass(x.selected)),e.preventDefault()),u==d.upArrow){if(t=v&&c?o.prevAll(S.item+":not(."+x.filtered+")").eq(0):z.eq(0),a.index(t)<0)return void w.verbose("Up key pressed but reached top of current menu");w.verbose("Up key pressed, changing active item"),o.removeClass(x.selected),t.addClass(x.selected),w.set.scrollPosition(t),e.preventDefault()}if(u==d.downArrow){if(t=v&&c?t=o.nextAll(S.item+":not(."+x.filtered+")").eq(0):z.eq(0),0===t.length)return void w.verbose("Down key pressed but reached bottom of current menu");w.verbose("Down key pressed, changing active item"),z.removeClass(x.selected),t.addClass(x.selected),w.set.scrollPosition(t),e.preventDefault()}}else u==d.enter&&(w.verbose("Enter key pressed, showing dropdown"),w.show()),u==d.escape&&(w.verbose("Escape key pressed, closing dropdown"),w.hide()),u==d.downArrow&&(w.verbose("Down key pressed, showing dropdown"),w.show())},test:{toggle:function(e){w.determine.eventInMenu(e,w.toggle)&&e.preventDefault()},touch:function(e){w.determine.eventInMenu(e,function(){"touchstart"==e.type?w.timer=setTimeout(w.hide,y.delay.touch):"touchmove"==e.type&&clearTimeout(w.timer)}),e.stopPropagation()},hide:function(e){w.determine.eventInModule(e,w.hide)}},menu:{activate:function(){R=!0},deactivate:function(){R=!1}},item:{mouseenter:function(t){var n=e(this).children(S.menu),i=e(this).siblings(S.item).children(S.menu);n.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Showing sub-menu",n),e.each(i,function(){w.animate.hide(!1,e(this))}),w.animate.show(!1,n)},y.delay.show),t.preventDefault())},mouseleave:function(){var t=e(this).children(S.menu);t.length>0&&(clearTimeout(w.itemTimer),w.itemTimer=setTimeout(function(){w.verbose("Hiding sub-menu",t),w.animate.hide(!1,t)},y.delay.hide))},click:function(t){var n=e(this),i=e(t?t.target:""),o=n.find(S.menu),a=w.get.choiceText(n),r=w.get.choiceValue(n,a),s=function(){w.remove.searchTerm(),w.determine.selectAction(a,r)},l=o.length>0,c=o.find(i).length>0;c||l&&!y.allowCategorySelection||s()}},resetStyle:function(){e(this).removeAttr("style")}},determine:{selectAction:function(t,n){w.verbose("Determining action",y.action),e.isFunction(w.action[y.action])?(w.verbose("Triggering preset action",y.action,t,n),w.action[y.action](t,n)):e.isFunction(y.action)?(w.verbose("Triggering user action",y.action,t,n),y.action(t,n)):w.error(k.action,y.action)},eventInModule:function(t,n){return n=e.isFunction(n)?n:function(){},0===e(t.target).closest(E).length?(w.verbose("Triggering event",n),n(),!0):(w.verbose("Event occurred in dropdown, canceling callback"),!1)},eventInMenu:function(t,n){return n=e.isFunction(n)?n:function(){},0===e(t.target).closest(V).length?(w.verbose("Triggering event",n),n(),!0):(w.verbose("Event occurred in dropdown menu, canceling callback"),!1)}},action:{nothing:function(){},activate:function(e,t){t=t!==i?t:e,w.set.selected(t),w.hide(function(){w.remove.filteredItem()})},select:function(e,t){t=t!==i?t:e,w.set.selected(t),w.hide(function(){w.remove.filteredItem()})},combo:function(e,t){t=t!==i?t:e,w.set.selected(t),w.hide(function(){w.remove.filteredItem()})},hide:function(){w.hide(function(){w.remove.filteredItem()})}},get:{id:function(){return g},text:function(){return D.text()},uniqueArray:function(t){return e.grep(t,function(n,i){return e.inArray(n,t)===i})},value:function(){return q.length>0?q.val():E.data(T.value)},values:function(){var t=w.get.value();return e.isArray(t)?t:[t]},choiceText:function(e,t){return t=t!==i?t:y.preserveHTML,e!==i?(e.find(S.menu).length>0&&(w.verbose("Retreiving text of element with sub-menu"),e=e.clone(),e.find(S.menu).remove(),e.find(S.menuIcon).remove()),e.data(T.text)!==i?e.data(T.text):t?e.html().trim():e.text().trim()):void 0},choiceValue:function(e,t){return t=t||w.get.choiceText(e),e.data(T.value)!==i?e.data(T.value):"string"==typeof t?t.toLowerCase().trim():t.trim()},inputEvent:function(){var e=F[0];return e?e.oninput!==i?"input":e.onpropertychange!==i?"propertychange":"keyup":!1},selectValues:function(){var t={};return t.values=y.sortSelect?{}:[],E.find("option").each(function(){var n=e(this).html(),o=e(this).attr("value")!==i?e(this).attr("value"):n;""===o?t.placeholder=n:y.sortSelect?t.values[o]={name:n,value:o}:t.values.push({name:n,value:o})}),y.sortSelect?w.debug("Retrieved and sorted values from select",t):w.debug("Retreived values from select",t),t},activeItem:function(){return z.filter("."+x.active)},item:function(t,n){var o=(w.is.multiple(),!1);return t=t!==i?t:w.get.value()!==i?w.get.value():w.get.text(),n=""===t||0===t?!0:n||!1,t!==i?z.each(function(){var i=e(this),a=w.get.choiceText(i),r=w.get.choiceValue(i,a);if(n){if(w.verbose("Ambiguous dropdown value using strict type check",i,t),r===t)return o=e(this),!0;if(!o&&a===t)return o=e(this),!0}else{if(r==t)return w.verbose("Found select item by value",r,t),o=e(this),!0;if(!o&&a==t)return w.verbose("Found select item by text",a,t),o=e(this),!0}}):t=w.get.text(),o||!1}},restore:{defaults:function(){w.restore.defaultText(),w.restore.defaultValue()},defaultText:function(){var e=E.data(T.defaultText);w.debug("Restoring default text",e),w.set.text(e),D.addClass(x.placeholder)},defaultValue:function(){var e=E.data(T.defaultValue);e!==i&&(w.debug("Restoring default value",e),e.length?w.set.selected(e):(w.remove.activeItem(),w.remove.selectedItem()))}},save:{defaults:function(){w.save.defaultText(),w.save.placeholderText(),w.save.defaultValue()},defaultValue:function(){E.data(T.defaultValue,w.get.value())},defaultText:function(){E.data(T.defaultText,D.text())},placeholderText:function(){D.hasClass(x.placeholder)&&E.data(T.placeholderText,D.text())}},clear:function(){var e=E.data(T.placeholderText);w.set.text(e),w.clearValue(),w.remove.activeItem(),w.remove.selectedItem(),D.addClass(x.placeholder)},clearValue:function(){w.set.value("")},set:{filtered:function(){var e=F.val(),t="string"==typeof e&&e.length>0;t?D.addClass(x.filtered):D.removeClass(x.filtered)},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),F.val("").attr("tabindex",0),V.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),E.attr("tabindex")||(E.attr("tabindex",0),V.attr("tabindex","-1")))},scrollPosition:function(e,t){var n,o,a,r,s,l,c,u,d,f=5;e=e||w.get.activeItem(),n=e&&e.length>0,t=t!==i?t:!1,e&&n&&(V.hasClass(x.visible)||V.addClass(x.loading),c=V.height(),a=e.height(),l=V.scrollTop(),s=V.offset().top,r=e.offset().top,o=l-s+r,d=o+f>l+c,u=l>o-f,w.debug("Scrolling to active item",o),(u||d||t)&&V.scrollTop(o).removeClass(x.loading))},text:function(e){"combo"==y.action?(w.debug("Changing combo button text",e,O),y.preserveHTML?O.html(e):O.text(e)):"select"!==y.action&&(w.debug("Changing text",e,D),D.removeClass(x.filtered).removeClass(x.placeholder),y.preserveHTML?D.html(e):D.text(e))},value:function(t){if(w.debug("Adding selected value to hidden input",t,q),q.length>0)if(w.is.multiple()){var n=w.get.values();e.isArray(n)?(n.push(t),n=w.get.uniqueArray(n)):n=[t],w.debug("Adding value to multiple",t,n),w.set.values(n)}else w.debug("Updating input value",t),q.val(t).trigger("change");else E.data(T.value,t)},values:function(e){q.is("select")?(q.val(e),w.debug("Setting mutiple select values",e,q)):(e=e.join(","),q.val(e),w.debug("Setting hidden input to comma separatd values",e,q))},active:function(){E.addClass(x.active)},multiple:function(){E.addClass(x.multiple)},visible:function(){E.addClass(x.visible)},selected:function(e){var t,n,i=w.get.item(e);i&&!i.hasClass(x.active)&&(w.debug("Setting selected menu item to",i),w.remove.activeItem(),w.remove.selectedItem(),i.addClass(x.active).addClass(x.selected),t=w.get.choiceText(i),n=w.get.choiceValue(i,t),w.set.text(t),w.set.value(n),y.onChange.call(P,e,t,i))}},remove:{active:function(){E.removeClass(x.active)},visible:function(){E.removeClass(x.visible)},activeItem:function(){z.removeClass(x.active)},filteredItem:function(){z.removeClass(x.filtered)},searchTerm:function(){F.val("")},selectedItem:function(){z.removeClass(x.selected)},tabbable:function(){w.has.search()?(w.debug("Searchable dropdown initialized"),F.attr("tabindex","-1"),V.attr("tabindex","-1")):(w.debug("Simple selection dropdown initialized"),E.attr("tabindex","-1"),V.attr("tabindex","-1"))}},has:{labels:function(){return M.length>0},search:function(){return F.length>0},input:function(){return q.length>0},menu:function(){return V.length>0}},is:{active:function(){return E.hasClass(x.active)},alreadySetup:function(){return E.is("select")&&E.parent(S.dropdown).length>0},animating:function(e){return e?e.is(":animated")||e.transition&&e.transition("is animating"):V.is(":animated")||V.transition&&V.transition("is animating")},allFiltered:function(){return z.filter("."+x.filtered).length===z.length},hidden:function(e){return e?e.is(":hidden"):V.is(":hidden")},multiple:function(){return E.hasClass(x.multiple)},selectMutation:function(t){var n=!1;return e.each(t,function(t,i){return i.target&&e(i.target).is("select")?(n=!0,!0):void 0}),n},search:function(){return E.hasClass(x.search)},searchSelection:function(){return w.has.search()&&0==F.closest(S.menu).length},selection:function(){return E.hasClass(x.selection)},upward:function(){return E.hasClass(x.upward)},visible:function(e){return e?e.is(":visible"):V.is(":visible")}},can:{click:function(){return c||"click"==y.on},show:function(){return!E.hasClass(x.disabled)}},animate:{show:function(t,n){var o=n||V,a=n?function(){}:function(){w.hideSubMenus(),w.hideOthers(),w.set.active()};t=e.isFunction(t)?t:function(){},w.set.scrollPosition(w.get.activeItem(),!0),w.verbose("Doing menu show animation",o),(w.is.hidden(o)||w.is.animating(o))&&("auto"==y.transition&&(y.transition=w.is.upward()?"slide up":"slide down",w.verbose("Automatically determining animation based on animation direction",y.transition)),"none"==y.transition?t.call(P):e.fn.transition!==i&&E.transition("is supported")?o.transition({animation:y.transition+" in",debug:y.debug,verbose:y.verbose,duration:y.duration,queue:!0,onStart:a,onComplete:function(){t.call(P)}}):"slide down"==y.transition?(a(),o.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},y.duration,"easeOutQuad",w.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){w.event.resetStyle.call(this),t.call(P)})):"fade"==y.transition?(a(),o.hide().clearQueue().fadeIn(y.duration,function(){w.event.resetStyle.call(this),t.call(P)})):w.error(k.transition,y.transition))},hide:function(t,n){var o=n||V,a=(n?.9*y.duration:y.duration,n?function(){}:function(){w.can.click()&&w.unbind.intent(),w.focusSearch(),w.remove.active()});t=e.isFunction(t)?t:function(){},(w.is.visible(o)||w.is.animating(o))&&(w.verbose("Doing menu hide animation",o),"auto"==y.transition&&(y.transition=w.is.upward()?"slide up":"slide down"),q.trigger("blur"),"none"==y.transition?t.call(P):e.fn.transition!==i&&E.transition("is supported")?o.transition({animation:y.transition+" out",duration:y.duration,debug:y.debug,verbose:y.verbose,queue:!0,onStart:a,onComplete:function(){t.call(P)}}):"slide down"==y.transition?(a(),o.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",w.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){w.event.resetStyle.call(this),t.call(P)})):"fade"==y.transition?(a(),o.show().clearQueue().fadeOut(150,function(){w.event.resetStyle.call(this),t.call(P)})):w.error(k.transition))}},delay:{show:function(){w.verbose("Delaying show event to ensure user intent"),clearTimeout(w.timer),w.timer=setTimeout(w.show,y.delay.show)},hide:function(){w.verbose("Delaying hide event to ensure user intent"),clearTimeout(w.timer),w.timer=setTimeout(w.hide,y.delay.hide)}},escape:{regExp:function(e){return e=String(e),e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},setting:function(t,n){if(w.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,y,t);else{if(n===i)return y[t];y[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,w,t);else{if(n===i)return w[t];w[t]=n}},debug:function(){y.debug&&(y.performance?w.performance.log(arguments):(w.debug=Function.prototype.bind.call(console.info,console,y.name+":"),w.debug.apply(console,arguments)))},verbose:function(){y.verbose&&y.debug&&(y.performance?w.performance.log(arguments):(w.verbose=Function.prototype.bind.call(console.info,console,y.name+":"),w.verbose.apply(console,arguments)))},error:function(){w.error=Function.prototype.bind.call(console.error,console,y.name+":"),w.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;y.performance&&(t=(new Date).getTime(),i=u||t,n=t-i,u=t,d.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(w.performance.timer),w.performance.timer=setTimeout(w.performance.display,500)},display:function(){var t=y.name+":",n=0;u=!1,clearTimeout(w.performance.timer),e.each(d,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",l&&(t+=" '"+l+"'"),(console.group!==i||console.table!==i)&&d.length>0&&(console.groupCollapsed(t),console.table?console.table(d):e.each(d,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),d=[]}},invoke:function(t,n,o){var r,s,l,c=H;return n=n||h,o=P||o,"string"==typeof t&&c!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(c[a])&&n!=r)c=c[a];else{if(c[a]!==i)return s=c[a],!1;if(!e.isPlainObject(c[o])||n==r)return c[o]!==i?(s=c[o],!1):(w.error(k.method,t),!1);c=c[o]}})),e.isFunction(s)?l=s.apply(o,n):s!==i&&(l=s),e.isArray(a)?a.push(l):a!==i?a=[a,l]:l!==i&&(a=l),s}},v?(H===i&&w.initialize(),w.invoke(f)):(H!==i&&H.invoke("destroy"),w.initialize())}),a!==i?a:r},e.fn.dropdown.settings={debug:!1,verbose:!0,performance:!0,on:"click",action:"activate",allowTab:!0,fullTextSearch:!1,preserveHTML:!0,sortSelect:!1,allowCategorySelection:!1,delay:{hide:300,show:200,search:50,touch:50},forceSelection:!0,transition:"auto",duration:250,onNoResults:function(){},onChange:function(){},onShow:function(){},onHide:function(){},name:"Dropdown",namespace:"dropdown",error:{action:"You called a dropdown action that was not defined",alreadySetup:"Once a select has been initialized behaviors must be called on the created ui dropdown",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{defaultText:"defaultText",defaultValue:"defaultValue",placeholderText:"placeholderText",text:"text",value:"value"},selector:{dropdown:".ui.dropdown",input:'> input[type="hidden"], > select',item:".item",labels:"> .labels",menu:".menu",menuIcon:".dropdown.icon",search:"input.search, .menu > .search > input",text:"> .text:not(.icon)"},className:{active:"active",animating:"animating",disabled:"disabled",dropdown:"ui dropdown",filtered:"filtered",labels:"labels",loading:"loading",menu:"menu",multiple:"multiple",placeholder:"default",search:"search",selected:"selected",selection:"selection",upward:"upward",visible:"visible"}},e.fn.dropdown.settings.templates={menu:function(t){var n=(t.placeholder||!1,t.values||{},"");return e.each(t.values,function(e,t){n+='<div class="item" data-value="'+t.value+'">'+t.name+"</div>"}),n},dropdown:function(t){var n=t.placeholder||!1,i=(t.values||{},"");return i+='<i class="dropdown icon"></i>',i+=t.placeholder?'<div class="default text">'+n+"</div>":'<div class="text"></div>',i+='<div class="menu">',e.each(t.values,function(e,t){i+='<div class="item" data-value="'+t.value+'">'+t.name+"</div>"}),i+="</div>"}},e.extend(e.easing,{easeOutQuad:function(e,t,n,i,o){return-i*(t/=o)*(t-2)+n}})}(jQuery,window,document);
|