diff --git a/RELEASE NOTES.md b/RELEASE NOTES.md index 0015920eb..2a96f2ac0 100755 --- a/RELEASE NOTES.md +++ b/RELEASE NOTES.md @@ -3,8 +3,9 @@ ### Version 0.2.5- Sep 28, 2013 **Fixes** - +- Fixes checkbox selector issue with multiple inputs inside a checkbox - Modal no longer uses inline css to center when in fixed position mode +- Fixes dropdown to now set active item to whatever hidden input field is when using action updateForm ### Version 0.2.4- Sep 28, 2013 diff --git a/build/less/modules/dropdown.js b/build/less/modules/dropdown.js index e27b03abd..0cbd1ed97 100644 --- a/build/less/modules/dropdown.js +++ b/build/less/modules/dropdown.js @@ -81,7 +81,7 @@ $.fn.dropdown = function(parameters) { .on(settings.on + eventNamespace, module.toggle) ; } - if(settings.action == 'form') { + if(settings.action == 'updateForm') { module.set.selected(); } $item diff --git a/build/minified/modules/checkbox.min.js b/build/minified/modules/checkbox.min.js index 233b37d67..1aa89f457 100644 --- a/build/minified/modules/checkbox.min.js +++ b/build/minified/modules/checkbox.min.js @@ -1 +1 @@ -!function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.checkbox.settings,b),g=f.className,h=f.namespace,i=f.error,j="."+h,k="module-"+h,l=e.selector||"",m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),r=a(this).next(f.selector.label).first(),s=a(this).find(f.selector.input),t=h.selector||"",u=h.data(k),v=this;b={initialize:function(){b.verbose("Initializing checkbox",f),f.context&&""!==t?(b.verbose("Adding delegated events"),a(v,f.context).on(t,"click"+j,b.toggle).on(t+" + "+f.selector.label,"click"+j,b.toggle)):(h.on("click"+j,b.toggle).data(k,b),r.on("click"+j,b.toggle)),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),u=b,h.data(k,b)},destroy:function(){b.verbose("Destroying previous module"),h.off(j).removeData(k)},is:{radio:function(){return h.hasClass(g.radio)}},can:{disable:function(){return"boolean"==typeof f.required?f.required:!b.is.radio()}},enable:function(){b.debug("Enabling checkbox"),s.prop("checked",!0),a.proxy(f.onChange,s.get())(),a.proxy(f.onEnable,s.get())()},disable:function(){b.debug("Disabling checkbox"),s.prop("checked",!1),a.proxy(f.onChange,s.get())(),a.proxy(f.onDisable,s.get())()},toggle:function(){b.verbose("Determining new checkbox state"),s.prop("checked")!==d&&s.prop("checked")?b.can.disable()&&b.disable():b.enable()},setting:function(b,c){return c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=m||c,d=c-e,m=c,n.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",g=0;m=!1,clearTimeout(b.performance.timer),a.each(n,function(a,b){g+=b["Execution Time"]}),c+=" "+g+"ms",l&&(c+=" '"+l+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(c),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(e,f,g){var h,j,k;return f=f||q,g=v||g,"string"==typeof e&&u!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(u[f])&&c!=h)u=u[f];else{if(!a.isPlainObject(u[g])||c==h)return u[f]!==d?(j=u[f],!1):u[g]!==d?(j=u[g],!1):(b.error(i.method),!1);u=u[g]}})),a.isFunction(j)?k=j.apply(g,f):j!==d&&(k=j),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),j}},p?(u===d&&b.initialize(),b.invoke(o)):(u!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input",label:"label"},className:{radio:"radio"}}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.checkbox.settings,b),g=f.className,h=f.namespace,i=f.error,j="."+h,k="module-"+h,l=e.selector||"",m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),r=a(this).next(f.selector.label).first(),s=a(this).find(f.selector.input),t=h.selector||"",u=h.data(k),v=this;b={initialize:function(){b.verbose("Initializing checkbox",f),f.context&&""!==t?(b.verbose("Adding delegated events"),a(v,f.context).on(t,"click"+j,b.toggle).on(t+" + "+f.selector.label,"click"+j,b.toggle)):(h.on("click"+j,b.toggle).data(k,b),r.on("click"+j,b.toggle)),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),u=b,h.data(k,b)},destroy:function(){b.verbose("Destroying previous module"),h.off(j).removeData(k)},is:{radio:function(){return h.hasClass(g.radio)}},can:{disable:function(){return"boolean"==typeof f.required?f.required:!b.is.radio()}},enable:function(){b.debug("Enabling checkbox"),s.prop("checked",!0),a.proxy(f.onChange,s.get())(),a.proxy(f.onEnable,s.get())()},disable:function(){b.debug("Disabling checkbox"),s.prop("checked",!1),a.proxy(f.onChange,s.get())(),a.proxy(f.onDisable,s.get())()},toggle:function(){b.verbose("Determining new checkbox state"),s.prop("checked")!==d&&s.prop("checked")?b.can.disable()&&b.disable():b.enable()},setting:function(b,c){return c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=m||c,d=c-e,m=c,n.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",g=0;m=!1,clearTimeout(b.performance.timer),a.each(n,function(a,b){g+=b["Execution Time"]}),c+=" "+g+"ms",l&&(c+=" '"+l+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(c),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(e,f,g){var h,j,k;return f=f||q,g=v||g,"string"==typeof e&&u!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(u[f])&&c!=h)u=u[f];else{if(!a.isPlainObject(u[g])||c==h)return u[f]!==d?(j=u[f],!1):u[g]!==d?(j=u[g],!1):(b.error(i.method),!1);u=u[g]}})),a.isFunction(j)?k=j.apply(g,f):j!==d&&(k=j),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),j}},p?(u===d&&b.initialize(),b.invoke(o)):(u!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input[type=checkbox]",label:"label"},className:{radio:"radio"}}}(jQuery,window,document); \ No newline at end of file diff --git a/build/minified/modules/dropdown.js b/build/minified/modules/dropdown.js index e27b03abd..0cbd1ed97 100644 --- a/build/minified/modules/dropdown.js +++ b/build/minified/modules/dropdown.js @@ -81,7 +81,7 @@ $.fn.dropdown = function(parameters) { .on(settings.on + eventNamespace, module.toggle) ; } - if(settings.action == 'form') { + if(settings.action == 'updateForm') { module.set.selected(); } $item diff --git a/build/minified/modules/dropdown.min.js b/build/minified/modules/dropdown.min.js index 03fd7d22b..1f6c226c4 100644 --- a/build/minified/modules/dropdown.min.js +++ b/build/minified/modules/dropdown.min.js @@ -1 +1 @@ -!function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,i=h.className,j=h.metadata,k=h.namespace,l=h.selector,m=h.error,n="."+k,o="module-"+k,p=f.selector||"",q=(new Date).getTime(),r=[],s=arguments[0],t="string"==typeof s,u=[].slice.call(arguments,1);return f.each(function(){var b,e=a(this),k=e.find(l.item),v=e.find(l.text),w=e.find(l.input),x=e.children(l.menu),y="ontouchstart"in c.documentElement,z=this,A=e.data(o);b={initialize:function(){b.debug("Initializing dropdown",h),y?e.on("touchstart"+n,b.event.test.toggle):"click"==h.on?e.on("click"+n,b.event.test.toggle):"hover"==h.on?e.on("mouseenter"+n,b.delay.show).on("mouseleave"+n,b.delay.hide):e.on(h.on+n,b.toggle),"form"==h.action&&b.set.selected(),k.on("mouseenter"+n,b.event.item.mouseenter).on("mouseleave"+n,b.event.item.mouseleave).on(b.get.selectEvent()+n,b.event.item.click),b.instantiate()},instantiate:function(){b.verbose("Storing instance of dropdown",b),e.data(o,b)},destroy:function(){b.verbose("Destroying previous dropdown for",e),k.off(n),e.off(n).removeData(o)},event:{stopPropagation:function(a){a.stopPropagation()},test:{toggle:function(a){b.determine.intent(a,b.toggle),a.stopImmediatePropagation()},hide:function(a){b.determine.intent(a,b.hide),a.stopPropagation()}},item:{mouseenter:function(){var c=a(this).find(l.menu),d=a(this).siblings(l.item).children(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.animate.hide(!1,d),b.verbose("Showing sub-menu",c),b.animate.show(!1,c)},2*h.delay.show))},mouseleave:function(){var c=a(this).find(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.verbose("Hiding sub-menu",c),b.animate.hide(!1,c)},h.delay.hide))},click:function(c){var d=a(this),e=d.data(j.text)||d.text(),f=d.data(j.value)||e.toLowerCase();0===d.find(l.menu).size()&&(b.verbose("Adding active state to selected item"),k.removeClass(i.active),d.addClass(i.active),b.determine.selectAction(e,f),a.proxy(h.onChange,z)(f,e),c.stopPropagation())}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(c,d){b.verbose("Determining action",h.action),a.isFunction(b[h.action])?(b.verbose("Triggering preset action",h.action),b[h.action](c,d)):a.isFunction(h.action)?(b.verbose("Triggering user action",h.action),h.action(c,d)):b.error(m.action)},intent:function(c,d){b.debug("Determining whether event occurred in dropdown",c.target),d=d||function(){},0===a(c.target).closest(x).size()?(b.verbose("Triggering event",d),d()):b.verbose("Event occurred in dropdown, canceling callback")}},bind:{intent:function(){b.verbose("Binding hide intent event to document"),g.on(b.get.selectEvent(),b.event.test.hide)}},unbind:{intent:function(){b.verbose("Removing hide intent event from document"),g.off(b.get.selectEvent())}},nothing:function(){},changeText:function(a){b.set.text(a),b.hide()},updateForm:function(a,c){b.set.text(a),b.set.value(c),b.hide()},get:{selectEvent:function(){return y?"touchstart":"click"},text:function(){return v.text()},value:function(){return w.val()},item:function(b){var c;return b=b||w.val(),k.each(function(){a(this).data(j.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){b.debug("Changing text",a,v),v.removeClass(i.placeholder),v.text(a)},value:function(a){b.debug("Adding selected value to hidden input",a,w),w.val(a)},active:function(){e.addClass(i.active)},visible:function(){e.addClass(i.visible)},selected:function(a){var c,d=b.get.item(a);d&&(b.debug("Setting selected menu item to",d),c=d.data(j.text)||d.text(),k.removeClass(i.active),d.addClass(i.active),b.set.text(c))}},remove:{active:function(){e.removeClass(i.active)},visible:function(){e.removeClass(i.visible)}},is:{visible:function(a){return a?a.is(":animated, :visible"):x.is(":animated, :visible")},hidden:function(a){return a?a.is(":not(:animated, :visible)"):x.is(":not(:animated, :visible)")}},can:{click:function(){return y||"click"==h.on},show:function(){return!e.hasClass(i.disabled)}},animate:{show:function(c,e){var f=e||x;c=c||function(){},b.is.hidden(f)&&(b.verbose("Doing menu show animation",f),"none"==h.transition?c():a.fn.transition!==d?f.transition({animation:h.transition+" in",duration:h.duration,complete:c,queue:!1}):"slide down"==h.transition?f.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},h.duration,"easeOutQuad",b.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.hide().clearQueue().fadeIn(h.duration,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))},hide:function(c,e){var f=e||x;c=c||function(){},b.is.visible(f)&&(b.verbose("Doing menu hide animation",f),a.fn.transition!==d?f.transition({animation:h.transition+" out",duration:h.duration,complete:c,queue:!1}):"none"==h.transition?c():"slide down"==h.transition?f.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",b.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.show().clearQueue().fadeOut(150,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))}},show:function(){b.debug("Checking if dropdown can show"),b.is.hidden()&&(b.hideOthers(),b.set.active(),b.animate.show(b.set.visible),b.can.click()&&b.bind.intent(),a.proxy(h.onShow,z)())},hide:function(){b.is.visible()&&(b.debug("Hiding dropdown"),b.can.click()&&b.unbind.intent(),b.remove.active(),b.animate.hide(b.remove.visible),a.proxy(h.onHide,z)())},delay:{show:function(){b.verbose("Delaying show event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.show,h.delay.show)},hide:function(){b.verbose("Delaying hide event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.hide,h.delay.hide)}},hideOthers:function(){b.verbose("Finding other dropdowns to hide"),f.not(e).has(l.menu+":visible").dropdown("hide")},toggle:function(){b.verbose("Toggling menu visibility"),b.is.hidden()?b.show():b.hide()},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=q||c,d=c-e,q=c,r.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;q=!1,clearTimeout(b.performance.timer),a.each(r,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",p&&(c+=" '"+p+"'"),(console.group!==d||console.table!==d)&&r.length>0&&(console.groupCollapsed(c),console.table?console.table(r):a.each(r,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(c,e,f){var g,h;return e=e||u,f=z||f,"string"==typeof c&&A!==d&&(c=c.split(/[\. ]/),g=c.length-1,a.each(c,function(c,e){a.isPlainObject(A[e])&&c!=g?A=A[e]:A[e]!==d?h=A[e]:b.error(m.method)})),a.isFunction(h)?h.apply(f,e):h||!1}},t?(A===d&&b.initialize(),b.invoke(s)):(A!==d&&b.destroy(),b.initialize())}),e?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"hide",delay:{show:200,hide:300},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible"}}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,i=h.className,j=h.metadata,k=h.namespace,l=h.selector,m=h.error,n="."+k,o="module-"+k,p=f.selector||"",q=(new Date).getTime(),r=[],s=arguments[0],t="string"==typeof s,u=[].slice.call(arguments,1);return f.each(function(){var b,e=a(this),k=e.find(l.item),v=e.find(l.text),w=e.find(l.input),x=e.children(l.menu),y="ontouchstart"in c.documentElement,z=this,A=e.data(o);b={initialize:function(){b.debug("Initializing dropdown",h),y?e.on("touchstart"+n,b.event.test.toggle):"click"==h.on?e.on("click"+n,b.event.test.toggle):"hover"==h.on?e.on("mouseenter"+n,b.delay.show).on("mouseleave"+n,b.delay.hide):e.on(h.on+n,b.toggle),"updateForm"==h.action&&b.set.selected(),k.on("mouseenter"+n,b.event.item.mouseenter).on("mouseleave"+n,b.event.item.mouseleave).on(b.get.selectEvent()+n,b.event.item.click),b.instantiate()},instantiate:function(){b.verbose("Storing instance of dropdown",b),e.data(o,b)},destroy:function(){b.verbose("Destroying previous dropdown for",e),k.off(n),e.off(n).removeData(o)},event:{stopPropagation:function(a){a.stopPropagation()},test:{toggle:function(a){b.determine.intent(a,b.toggle),a.stopImmediatePropagation()},hide:function(a){b.determine.intent(a,b.hide),a.stopPropagation()}},item:{mouseenter:function(){var c=a(this).find(l.menu),d=a(this).siblings(l.item).children(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.animate.hide(!1,d),b.verbose("Showing sub-menu",c),b.animate.show(!1,c)},2*h.delay.show))},mouseleave:function(){var c=a(this).find(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.verbose("Hiding sub-menu",c),b.animate.hide(!1,c)},h.delay.hide))},click:function(c){var d=a(this),e=d.data(j.text)||d.text(),f=d.data(j.value)||e.toLowerCase();0===d.find(l.menu).size()&&(b.verbose("Adding active state to selected item"),k.removeClass(i.active),d.addClass(i.active),b.determine.selectAction(e,f),a.proxy(h.onChange,z)(f,e),c.stopPropagation())}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(c,d){b.verbose("Determining action",h.action),a.isFunction(b[h.action])?(b.verbose("Triggering preset action",h.action),b[h.action](c,d)):a.isFunction(h.action)?(b.verbose("Triggering user action",h.action),h.action(c,d)):b.error(m.action)},intent:function(c,d){b.debug("Determining whether event occurred in dropdown",c.target),d=d||function(){},0===a(c.target).closest(x).size()?(b.verbose("Triggering event",d),d()):b.verbose("Event occurred in dropdown, canceling callback")}},bind:{intent:function(){b.verbose("Binding hide intent event to document"),g.on(b.get.selectEvent(),b.event.test.hide)}},unbind:{intent:function(){b.verbose("Removing hide intent event from document"),g.off(b.get.selectEvent())}},nothing:function(){},changeText:function(a){b.set.text(a),b.hide()},updateForm:function(a,c){b.set.text(a),b.set.value(c),b.hide()},get:{selectEvent:function(){return y?"touchstart":"click"},text:function(){return v.text()},value:function(){return w.val()},item:function(b){var c;return b=b||w.val(),k.each(function(){a(this).data(j.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){b.debug("Changing text",a,v),v.removeClass(i.placeholder),v.text(a)},value:function(a){b.debug("Adding selected value to hidden input",a,w),w.val(a)},active:function(){e.addClass(i.active)},visible:function(){e.addClass(i.visible)},selected:function(a){var c,d=b.get.item(a);d&&(b.debug("Setting selected menu item to",d),c=d.data(j.text)||d.text(),k.removeClass(i.active),d.addClass(i.active),b.set.text(c))}},remove:{active:function(){e.removeClass(i.active)},visible:function(){e.removeClass(i.visible)}},is:{visible:function(a){return a?a.is(":animated, :visible"):x.is(":animated, :visible")},hidden:function(a){return a?a.is(":not(:animated, :visible)"):x.is(":not(:animated, :visible)")}},can:{click:function(){return y||"click"==h.on},show:function(){return!e.hasClass(i.disabled)}},animate:{show:function(c,e){var f=e||x;c=c||function(){},b.is.hidden(f)&&(b.verbose("Doing menu show animation",f),"none"==h.transition?c():a.fn.transition!==d?f.transition({animation:h.transition+" in",duration:h.duration,complete:c,queue:!1}):"slide down"==h.transition?f.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},h.duration,"easeOutQuad",b.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.hide().clearQueue().fadeIn(h.duration,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))},hide:function(c,e){var f=e||x;c=c||function(){},b.is.visible(f)&&(b.verbose("Doing menu hide animation",f),a.fn.transition!==d?f.transition({animation:h.transition+" out",duration:h.duration,complete:c,queue:!1}):"none"==h.transition?c():"slide down"==h.transition?f.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",b.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.show().clearQueue().fadeOut(150,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))}},show:function(){b.debug("Checking if dropdown can show"),b.is.hidden()&&(b.hideOthers(),b.set.active(),b.animate.show(b.set.visible),b.can.click()&&b.bind.intent(),a.proxy(h.onShow,z)())},hide:function(){b.is.visible()&&(b.debug("Hiding dropdown"),b.can.click()&&b.unbind.intent(),b.remove.active(),b.animate.hide(b.remove.visible),a.proxy(h.onHide,z)())},delay:{show:function(){b.verbose("Delaying show event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.show,h.delay.show)},hide:function(){b.verbose("Delaying hide event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.hide,h.delay.hide)}},hideOthers:function(){b.verbose("Finding other dropdowns to hide"),f.not(e).has(l.menu+":visible").dropdown("hide")},toggle:function(){b.verbose("Toggling menu visibility"),b.is.hidden()?b.show():b.hide()},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=q||c,d=c-e,q=c,r.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;q=!1,clearTimeout(b.performance.timer),a.each(r,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",p&&(c+=" '"+p+"'"),(console.group!==d||console.table!==d)&&r.length>0&&(console.groupCollapsed(c),console.table?console.table(r):a.each(r,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(c,e,f){var g,h;return e=e||u,f=z||f,"string"==typeof c&&A!==d&&(c=c.split(/[\. ]/),g=c.length-1,a.each(c,function(c,e){a.isPlainObject(A[e])&&c!=g?A=A[e]:A[e]!==d?h=A[e]:b.error(m.method)})),a.isFunction(h)?h.apply(f,e):h||!1}},t?(A===d&&b.initialize(),b.invoke(s)):(A!==d&&b.destroy(),b.initialize())}),e?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"hide",delay:{show:200,hide:300},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible"}}}(jQuery,window,document); \ No newline at end of file diff --git a/build/packaged/javascript/semantic.js.REMOVED.git-id b/build/packaged/javascript/semantic.js.REMOVED.git-id index 2607fa81d..ce89a1512 100644 --- a/build/packaged/javascript/semantic.js.REMOVED.git-id +++ b/build/packaged/javascript/semantic.js.REMOVED.git-id @@ -1 +1 @@ -858a1a51f2960f9276829381524d0e5c95585725 \ No newline at end of file +9b147254d017958f700721ff39c60d11bdf971cc \ No newline at end of file diff --git a/build/packaged/javascript/semantic.min.js.REMOVED.git-id b/build/packaged/javascript/semantic.min.js.REMOVED.git-id index c7afbf46f..a0b06324d 100644 --- a/build/packaged/javascript/semantic.min.js.REMOVED.git-id +++ b/build/packaged/javascript/semantic.min.js.REMOVED.git-id @@ -1 +1 @@ -b457b9305ff78f255f3b348e246c9ee9c96d15dc \ No newline at end of file +3a6e005c9da9ba2d8bc73d7488c6072b899315ca \ No newline at end of file diff --git a/build/uncompressed/modules/dropdown.js b/build/uncompressed/modules/dropdown.js index e27b03abd..0cbd1ed97 100644 --- a/build/uncompressed/modules/dropdown.js +++ b/build/uncompressed/modules/dropdown.js @@ -81,7 +81,7 @@ $.fn.dropdown = function(parameters) { .on(settings.on + eventNamespace, module.toggle) ; } - if(settings.action == 'form') { + if(settings.action == 'updateForm') { module.set.selected(); } $item diff --git a/node/src/documents/modules/dropdown.html.eco b/node/src/documents/modules/dropdown.html.eco index 02386db99..8aec2b8ef 100755 --- a/node/src/documents/modules/dropdown.html.eco +++ b/node/src/documents/modules/dropdown.html.eco @@ -445,7 +445,7 @@ type : 'UI Module' on click - Event used to trigger dropdown + Event used to trigger dropdown (Hover, Click) delay @@ -457,7 +457,7 @@ type : 'UI Module' } - Time in milliseconds to debounce show or hide behavior + Time in milliseconds to debounce show or hide behavior when on: hover is used. transition diff --git a/node/src/files/build/less/modules/dropdown.js b/node/src/files/build/less/modules/dropdown.js index e27b03abd..0cbd1ed97 100644 --- a/node/src/files/build/less/modules/dropdown.js +++ b/node/src/files/build/less/modules/dropdown.js @@ -81,7 +81,7 @@ $.fn.dropdown = function(parameters) { .on(settings.on + eventNamespace, module.toggle) ; } - if(settings.action == 'form') { + if(settings.action == 'updateForm') { module.set.selected(); } $item diff --git a/node/src/files/build/minified/modules/checkbox.min.js b/node/src/files/build/minified/modules/checkbox.min.js index 233b37d67..1aa89f457 100644 --- a/node/src/files/build/minified/modules/checkbox.min.js +++ b/node/src/files/build/minified/modules/checkbox.min.js @@ -1 +1 @@ -!function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.checkbox.settings,b),g=f.className,h=f.namespace,i=f.error,j="."+h,k="module-"+h,l=e.selector||"",m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),r=a(this).next(f.selector.label).first(),s=a(this).find(f.selector.input),t=h.selector||"",u=h.data(k),v=this;b={initialize:function(){b.verbose("Initializing checkbox",f),f.context&&""!==t?(b.verbose("Adding delegated events"),a(v,f.context).on(t,"click"+j,b.toggle).on(t+" + "+f.selector.label,"click"+j,b.toggle)):(h.on("click"+j,b.toggle).data(k,b),r.on("click"+j,b.toggle)),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),u=b,h.data(k,b)},destroy:function(){b.verbose("Destroying previous module"),h.off(j).removeData(k)},is:{radio:function(){return h.hasClass(g.radio)}},can:{disable:function(){return"boolean"==typeof f.required?f.required:!b.is.radio()}},enable:function(){b.debug("Enabling checkbox"),s.prop("checked",!0),a.proxy(f.onChange,s.get())(),a.proxy(f.onEnable,s.get())()},disable:function(){b.debug("Disabling checkbox"),s.prop("checked",!1),a.proxy(f.onChange,s.get())(),a.proxy(f.onDisable,s.get())()},toggle:function(){b.verbose("Determining new checkbox state"),s.prop("checked")!==d&&s.prop("checked")?b.can.disable()&&b.disable():b.enable()},setting:function(b,c){return c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=m||c,d=c-e,m=c,n.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",g=0;m=!1,clearTimeout(b.performance.timer),a.each(n,function(a,b){g+=b["Execution Time"]}),c+=" "+g+"ms",l&&(c+=" '"+l+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(c),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(e,f,g){var h,j,k;return f=f||q,g=v||g,"string"==typeof e&&u!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(u[f])&&c!=h)u=u[f];else{if(!a.isPlainObject(u[g])||c==h)return u[f]!==d?(j=u[f],!1):u[g]!==d?(j=u[g],!1):(b.error(i.method),!1);u=u[g]}})),a.isFunction(j)?k=j.apply(g,f):j!==d&&(k=j),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),j}},p?(u===d&&b.initialize(),b.invoke(o)):(u!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input",label:"label"},className:{radio:"radio"}}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.checkbox=function(b){var c,e=a(this),f=a.extend(!0,{},a.fn.checkbox.settings,b),g=f.className,h=f.namespace,i=f.error,j="."+h,k="module-"+h,l=e.selector||"",m=(new Date).getTime(),n=[],o=arguments[0],p="string"==typeof o,q=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),r=a(this).next(f.selector.label).first(),s=a(this).find(f.selector.input),t=h.selector||"",u=h.data(k),v=this;b={initialize:function(){b.verbose("Initializing checkbox",f),f.context&&""!==t?(b.verbose("Adding delegated events"),a(v,f.context).on(t,"click"+j,b.toggle).on(t+" + "+f.selector.label,"click"+j,b.toggle)):(h.on("click"+j,b.toggle).data(k,b),r.on("click"+j,b.toggle)),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),u=b,h.data(k,b)},destroy:function(){b.verbose("Destroying previous module"),h.off(j).removeData(k)},is:{radio:function(){return h.hasClass(g.radio)}},can:{disable:function(){return"boolean"==typeof f.required?f.required:!b.is.radio()}},enable:function(){b.debug("Enabling checkbox"),s.prop("checked",!0),a.proxy(f.onChange,s.get())(),a.proxy(f.onEnable,s.get())()},disable:function(){b.debug("Disabling checkbox"),s.prop("checked",!1),a.proxy(f.onChange,s.get())(),a.proxy(f.onDisable,s.get())()},toggle:function(){b.verbose("Determining new checkbox state"),s.prop("checked")!==d&&s.prop("checked")?b.can.disable()&&b.disable():b.enable()},setting:function(b,c){return c===d?f[b]:(a.isPlainObject(b)?a.extend(!0,f,b):f[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=m||c,d=c-e,m=c,n.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",g=0;m=!1,clearTimeout(b.performance.timer),a.each(n,function(a,b){g+=b["Execution Time"]}),c+=" "+g+"ms",l&&(c+=" '"+l+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&n.length>0&&(console.groupCollapsed(c),console.table?console.table(n):a.each(n,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),n=[]}},invoke:function(e,f,g){var h,j,k;return f=f||q,g=v||g,"string"==typeof e&&u!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(u[f])&&c!=h)u=u[f];else{if(!a.isPlainObject(u[g])||c==h)return u[f]!==d?(j=u[f],!1):u[g]!==d?(j=u[g],!1):(b.error(i.method),!1);u=u[g]}})),a.isFunction(j)?k=j.apply(g,f):j!==d&&(k=j),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),j}},p?(u===d&&b.initialize(),b.invoke(o)):(u!==d&&b.destroy(),b.initialize())}),c!==d?c:this},a.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input[type=checkbox]",label:"label"},className:{radio:"radio"}}}(jQuery,window,document); \ No newline at end of file diff --git a/node/src/files/build/minified/modules/dropdown.js b/node/src/files/build/minified/modules/dropdown.js index e27b03abd..0cbd1ed97 100644 --- a/node/src/files/build/minified/modules/dropdown.js +++ b/node/src/files/build/minified/modules/dropdown.js @@ -81,7 +81,7 @@ $.fn.dropdown = function(parameters) { .on(settings.on + eventNamespace, module.toggle) ; } - if(settings.action == 'form') { + if(settings.action == 'updateForm') { module.set.selected(); } $item diff --git a/node/src/files/build/minified/modules/dropdown.min.js b/node/src/files/build/minified/modules/dropdown.min.js index 03fd7d22b..1f6c226c4 100644 --- a/node/src/files/build/minified/modules/dropdown.min.js +++ b/node/src/files/build/minified/modules/dropdown.min.js @@ -1 +1 @@ -!function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,i=h.className,j=h.metadata,k=h.namespace,l=h.selector,m=h.error,n="."+k,o="module-"+k,p=f.selector||"",q=(new Date).getTime(),r=[],s=arguments[0],t="string"==typeof s,u=[].slice.call(arguments,1);return f.each(function(){var b,e=a(this),k=e.find(l.item),v=e.find(l.text),w=e.find(l.input),x=e.children(l.menu),y="ontouchstart"in c.documentElement,z=this,A=e.data(o);b={initialize:function(){b.debug("Initializing dropdown",h),y?e.on("touchstart"+n,b.event.test.toggle):"click"==h.on?e.on("click"+n,b.event.test.toggle):"hover"==h.on?e.on("mouseenter"+n,b.delay.show).on("mouseleave"+n,b.delay.hide):e.on(h.on+n,b.toggle),"form"==h.action&&b.set.selected(),k.on("mouseenter"+n,b.event.item.mouseenter).on("mouseleave"+n,b.event.item.mouseleave).on(b.get.selectEvent()+n,b.event.item.click),b.instantiate()},instantiate:function(){b.verbose("Storing instance of dropdown",b),e.data(o,b)},destroy:function(){b.verbose("Destroying previous dropdown for",e),k.off(n),e.off(n).removeData(o)},event:{stopPropagation:function(a){a.stopPropagation()},test:{toggle:function(a){b.determine.intent(a,b.toggle),a.stopImmediatePropagation()},hide:function(a){b.determine.intent(a,b.hide),a.stopPropagation()}},item:{mouseenter:function(){var c=a(this).find(l.menu),d=a(this).siblings(l.item).children(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.animate.hide(!1,d),b.verbose("Showing sub-menu",c),b.animate.show(!1,c)},2*h.delay.show))},mouseleave:function(){var c=a(this).find(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.verbose("Hiding sub-menu",c),b.animate.hide(!1,c)},h.delay.hide))},click:function(c){var d=a(this),e=d.data(j.text)||d.text(),f=d.data(j.value)||e.toLowerCase();0===d.find(l.menu).size()&&(b.verbose("Adding active state to selected item"),k.removeClass(i.active),d.addClass(i.active),b.determine.selectAction(e,f),a.proxy(h.onChange,z)(f,e),c.stopPropagation())}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(c,d){b.verbose("Determining action",h.action),a.isFunction(b[h.action])?(b.verbose("Triggering preset action",h.action),b[h.action](c,d)):a.isFunction(h.action)?(b.verbose("Triggering user action",h.action),h.action(c,d)):b.error(m.action)},intent:function(c,d){b.debug("Determining whether event occurred in dropdown",c.target),d=d||function(){},0===a(c.target).closest(x).size()?(b.verbose("Triggering event",d),d()):b.verbose("Event occurred in dropdown, canceling callback")}},bind:{intent:function(){b.verbose("Binding hide intent event to document"),g.on(b.get.selectEvent(),b.event.test.hide)}},unbind:{intent:function(){b.verbose("Removing hide intent event from document"),g.off(b.get.selectEvent())}},nothing:function(){},changeText:function(a){b.set.text(a),b.hide()},updateForm:function(a,c){b.set.text(a),b.set.value(c),b.hide()},get:{selectEvent:function(){return y?"touchstart":"click"},text:function(){return v.text()},value:function(){return w.val()},item:function(b){var c;return b=b||w.val(),k.each(function(){a(this).data(j.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){b.debug("Changing text",a,v),v.removeClass(i.placeholder),v.text(a)},value:function(a){b.debug("Adding selected value to hidden input",a,w),w.val(a)},active:function(){e.addClass(i.active)},visible:function(){e.addClass(i.visible)},selected:function(a){var c,d=b.get.item(a);d&&(b.debug("Setting selected menu item to",d),c=d.data(j.text)||d.text(),k.removeClass(i.active),d.addClass(i.active),b.set.text(c))}},remove:{active:function(){e.removeClass(i.active)},visible:function(){e.removeClass(i.visible)}},is:{visible:function(a){return a?a.is(":animated, :visible"):x.is(":animated, :visible")},hidden:function(a){return a?a.is(":not(:animated, :visible)"):x.is(":not(:animated, :visible)")}},can:{click:function(){return y||"click"==h.on},show:function(){return!e.hasClass(i.disabled)}},animate:{show:function(c,e){var f=e||x;c=c||function(){},b.is.hidden(f)&&(b.verbose("Doing menu show animation",f),"none"==h.transition?c():a.fn.transition!==d?f.transition({animation:h.transition+" in",duration:h.duration,complete:c,queue:!1}):"slide down"==h.transition?f.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},h.duration,"easeOutQuad",b.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.hide().clearQueue().fadeIn(h.duration,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))},hide:function(c,e){var f=e||x;c=c||function(){},b.is.visible(f)&&(b.verbose("Doing menu hide animation",f),a.fn.transition!==d?f.transition({animation:h.transition+" out",duration:h.duration,complete:c,queue:!1}):"none"==h.transition?c():"slide down"==h.transition?f.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",b.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.show().clearQueue().fadeOut(150,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))}},show:function(){b.debug("Checking if dropdown can show"),b.is.hidden()&&(b.hideOthers(),b.set.active(),b.animate.show(b.set.visible),b.can.click()&&b.bind.intent(),a.proxy(h.onShow,z)())},hide:function(){b.is.visible()&&(b.debug("Hiding dropdown"),b.can.click()&&b.unbind.intent(),b.remove.active(),b.animate.hide(b.remove.visible),a.proxy(h.onHide,z)())},delay:{show:function(){b.verbose("Delaying show event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.show,h.delay.show)},hide:function(){b.verbose("Delaying hide event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.hide,h.delay.hide)}},hideOthers:function(){b.verbose("Finding other dropdowns to hide"),f.not(e).has(l.menu+":visible").dropdown("hide")},toggle:function(){b.verbose("Toggling menu visibility"),b.is.hidden()?b.show():b.hide()},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=q||c,d=c-e,q=c,r.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;q=!1,clearTimeout(b.performance.timer),a.each(r,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",p&&(c+=" '"+p+"'"),(console.group!==d||console.table!==d)&&r.length>0&&(console.groupCollapsed(c),console.table?console.table(r):a.each(r,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(c,e,f){var g,h;return e=e||u,f=z||f,"string"==typeof c&&A!==d&&(c=c.split(/[\. ]/),g=c.length-1,a.each(c,function(c,e){a.isPlainObject(A[e])&&c!=g?A=A[e]:A[e]!==d?h=A[e]:b.error(m.method)})),a.isFunction(h)?h.apply(f,e):h||!1}},t?(A===d&&b.initialize(),b.invoke(s)):(A!==d&&b.destroy(),b.initialize())}),e?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"hide",delay:{show:200,hide:300},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible"}}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){a.fn.dropdown=function(b){var e,f=a(this),g=a(c),h=a.isPlainObject(b)?a.extend(!0,{},a.fn.dropdown.settings,b):a.fn.dropdown.settings,i=h.className,j=h.metadata,k=h.namespace,l=h.selector,m=h.error,n="."+k,o="module-"+k,p=f.selector||"",q=(new Date).getTime(),r=[],s=arguments[0],t="string"==typeof s,u=[].slice.call(arguments,1);return f.each(function(){var b,e=a(this),k=e.find(l.item),v=e.find(l.text),w=e.find(l.input),x=e.children(l.menu),y="ontouchstart"in c.documentElement,z=this,A=e.data(o);b={initialize:function(){b.debug("Initializing dropdown",h),y?e.on("touchstart"+n,b.event.test.toggle):"click"==h.on?e.on("click"+n,b.event.test.toggle):"hover"==h.on?e.on("mouseenter"+n,b.delay.show).on("mouseleave"+n,b.delay.hide):e.on(h.on+n,b.toggle),"updateForm"==h.action&&b.set.selected(),k.on("mouseenter"+n,b.event.item.mouseenter).on("mouseleave"+n,b.event.item.mouseleave).on(b.get.selectEvent()+n,b.event.item.click),b.instantiate()},instantiate:function(){b.verbose("Storing instance of dropdown",b),e.data(o,b)},destroy:function(){b.verbose("Destroying previous dropdown for",e),k.off(n),e.off(n).removeData(o)},event:{stopPropagation:function(a){a.stopPropagation()},test:{toggle:function(a){b.determine.intent(a,b.toggle),a.stopImmediatePropagation()},hide:function(a){b.determine.intent(a,b.hide),a.stopPropagation()}},item:{mouseenter:function(){var c=a(this).find(l.menu),d=a(this).siblings(l.item).children(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.animate.hide(!1,d),b.verbose("Showing sub-menu",c),b.animate.show(!1,c)},2*h.delay.show))},mouseleave:function(){var c=a(this).find(l.menu);c.size()>0&&(clearTimeout(b.itemTimer),b.itemTimer=setTimeout(function(){b.verbose("Hiding sub-menu",c),b.animate.hide(!1,c)},h.delay.hide))},click:function(c){var d=a(this),e=d.data(j.text)||d.text(),f=d.data(j.value)||e.toLowerCase();0===d.find(l.menu).size()&&(b.verbose("Adding active state to selected item"),k.removeClass(i.active),d.addClass(i.active),b.determine.selectAction(e,f),a.proxy(h.onChange,z)(f,e),c.stopPropagation())}},resetStyle:function(){a(this).removeAttr("style")}},determine:{selectAction:function(c,d){b.verbose("Determining action",h.action),a.isFunction(b[h.action])?(b.verbose("Triggering preset action",h.action),b[h.action](c,d)):a.isFunction(h.action)?(b.verbose("Triggering user action",h.action),h.action(c,d)):b.error(m.action)},intent:function(c,d){b.debug("Determining whether event occurred in dropdown",c.target),d=d||function(){},0===a(c.target).closest(x).size()?(b.verbose("Triggering event",d),d()):b.verbose("Event occurred in dropdown, canceling callback")}},bind:{intent:function(){b.verbose("Binding hide intent event to document"),g.on(b.get.selectEvent(),b.event.test.hide)}},unbind:{intent:function(){b.verbose("Removing hide intent event from document"),g.off(b.get.selectEvent())}},nothing:function(){},changeText:function(a){b.set.text(a),b.hide()},updateForm:function(a,c){b.set.text(a),b.set.value(c),b.hide()},get:{selectEvent:function(){return y?"touchstart":"click"},text:function(){return v.text()},value:function(){return w.val()},item:function(b){var c;return b=b||w.val(),k.each(function(){a(this).data(j.value)==b&&(c=a(this))}),c||!1}},set:{text:function(a){b.debug("Changing text",a,v),v.removeClass(i.placeholder),v.text(a)},value:function(a){b.debug("Adding selected value to hidden input",a,w),w.val(a)},active:function(){e.addClass(i.active)},visible:function(){e.addClass(i.visible)},selected:function(a){var c,d=b.get.item(a);d&&(b.debug("Setting selected menu item to",d),c=d.data(j.text)||d.text(),k.removeClass(i.active),d.addClass(i.active),b.set.text(c))}},remove:{active:function(){e.removeClass(i.active)},visible:function(){e.removeClass(i.visible)}},is:{visible:function(a){return a?a.is(":animated, :visible"):x.is(":animated, :visible")},hidden:function(a){return a?a.is(":not(:animated, :visible)"):x.is(":not(:animated, :visible)")}},can:{click:function(){return y||"click"==h.on},show:function(){return!e.hasClass(i.disabled)}},animate:{show:function(c,e){var f=e||x;c=c||function(){},b.is.hidden(f)&&(b.verbose("Doing menu show animation",f),"none"==h.transition?c():a.fn.transition!==d?f.transition({animation:h.transition+" in",duration:h.duration,complete:c,queue:!1}):"slide down"==h.transition?f.hide().clearQueue().children().clearQueue().css("opacity",0).delay(50).animate({opacity:1},h.duration,"easeOutQuad",b.event.resetStyle).end().slideDown(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.hide().clearQueue().fadeIn(h.duration,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))},hide:function(c,e){var f=e||x;c=c||function(){},b.is.visible(f)&&(b.verbose("Doing menu hide animation",f),a.fn.transition!==d?f.transition({animation:h.transition+" out",duration:h.duration,complete:c,queue:!1}):"none"==h.transition?c():"slide down"==h.transition?f.show().clearQueue().children().clearQueue().css("opacity",1).animate({opacity:0},100,"easeOutQuad",b.event.resetStyle).end().delay(50).slideUp(100,"easeOutQuad",function(){a.proxy(b.event.resetStyle,this)(),c()}):"fade"==h.transition?f.show().clearQueue().fadeOut(150,function(){a.proxy(b.event.resetStyle,this)(),c()}):b.error(m.transition))}},show:function(){b.debug("Checking if dropdown can show"),b.is.hidden()&&(b.hideOthers(),b.set.active(),b.animate.show(b.set.visible),b.can.click()&&b.bind.intent(),a.proxy(h.onShow,z)())},hide:function(){b.is.visible()&&(b.debug("Hiding dropdown"),b.can.click()&&b.unbind.intent(),b.remove.active(),b.animate.hide(b.remove.visible),a.proxy(h.onHide,z)())},delay:{show:function(){b.verbose("Delaying show event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.show,h.delay.show)},hide:function(){b.verbose("Delaying hide event to ensure user intent"),clearTimeout(b.timer),b.timer=setTimeout(b.hide,h.delay.hide)}},hideOthers:function(){b.verbose("Finding other dropdowns to hide"),f.not(e).has(l.menu+":visible").dropdown("hide")},toggle:function(){b.verbose("Toggling menu visibility"),b.is.hidden()?b.show():b.hide()},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(c,e){return e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){h.debug&&(h.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,h.name+":"),b.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,h.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;h.performance&&(c=(new Date).getTime(),e=q||c,d=c-e,q=c,r.push({Element:z,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=h.name+":",e=0;q=!1,clearTimeout(b.performance.timer),a.each(r,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",p&&(c+=" '"+p+"'"),(console.group!==d||console.table!==d)&&r.length>0&&(console.groupCollapsed(c),console.table?console.table(r):a.each(r,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(c,e,f){var g,h;return e=e||u,f=z||f,"string"==typeof c&&A!==d&&(c=c.split(/[\. ]/),g=c.length-1,a.each(c,function(c,e){a.isPlainObject(A[e])&&c!=g?A=A[e]:A[e]!==d?h=A[e]:b.error(m.method)})),a.isFunction(h)?h.apply(f,e):h||!1}},t?(A===d&&b.initialize(),b.invoke(s)):(A!==d&&b.destroy(),b.initialize())}),e?e:this},a.fn.dropdown.settings={name:"Dropdown",namespace:"dropdown",verbose:!0,debug:!0,performance:!0,on:"click",action:"hide",delay:{show:200,hide:300},transition:"slide down",duration:250,onChange:function(){},onShow:function(){},onHide:function(){},error:{action:"You called a dropdown action that was not defined",method:"The method you called is not defined.",transition:"The requested transition was not found"},metadata:{text:"text",value:"value"},selector:{menu:".menu",item:".menu > .item",text:"> .text",input:'> input[type="hidden"]'},className:{active:"active",placeholder:"default",disabled:"disabled",visible:"visible"}}}(jQuery,window,document); \ No newline at end of file diff --git a/node/src/files/build/packaged/javascript/semantic.js.REMOVED.git-id b/node/src/files/build/packaged/javascript/semantic.js.REMOVED.git-id index 2607fa81d..ce89a1512 100644 --- a/node/src/files/build/packaged/javascript/semantic.js.REMOVED.git-id +++ b/node/src/files/build/packaged/javascript/semantic.js.REMOVED.git-id @@ -1 +1 @@ -858a1a51f2960f9276829381524d0e5c95585725 \ No newline at end of file +9b147254d017958f700721ff39c60d11bdf971cc \ No newline at end of file diff --git a/node/src/files/build/packaged/javascript/semantic.min.js.REMOVED.git-id b/node/src/files/build/packaged/javascript/semantic.min.js.REMOVED.git-id index c7afbf46f..a0b06324d 100644 --- a/node/src/files/build/packaged/javascript/semantic.min.js.REMOVED.git-id +++ b/node/src/files/build/packaged/javascript/semantic.min.js.REMOVED.git-id @@ -1 +1 @@ -b457b9305ff78f255f3b348e246c9ee9c96d15dc \ No newline at end of file +3a6e005c9da9ba2d8bc73d7488c6072b899315ca \ No newline at end of file diff --git a/node/src/files/build/semantic.zip.REMOVED.git-id b/node/src/files/build/semantic.zip.REMOVED.git-id index 86ea5580c..ea590a665 100644 --- a/node/src/files/build/semantic.zip.REMOVED.git-id +++ b/node/src/files/build/semantic.zip.REMOVED.git-id @@ -1 +1 @@ -78a97dc16a12c6bd5f0c792f1db0a52b4b385399 \ No newline at end of file +4a2257383118afc1254a1ea9e26a1e6bff9eecd3 \ No newline at end of file diff --git a/node/src/files/build/uncompressed/modules/dropdown.js b/node/src/files/build/uncompressed/modules/dropdown.js index e27b03abd..0cbd1ed97 100644 --- a/node/src/files/build/uncompressed/modules/dropdown.js +++ b/node/src/files/build/uncompressed/modules/dropdown.js @@ -81,7 +81,7 @@ $.fn.dropdown = function(parameters) { .on(settings.on + eventNamespace, module.toggle) ; } - if(settings.action == 'form') { + if(settings.action == 'updateForm') { module.set.selected(); } $item diff --git a/node/src/files/spec/module.commented.js b/node/src/files/spec/module.commented.js old mode 100644 new mode 100755