test/dummy/tmp/cache/assets/E05/E70/sprockets%2Fead5bfd3417fc5de81d3794c3e443cfe in cytoplasm-0.1.3 vs test/dummy/tmp/cache/assets/E05/E70/sprockets%2Fead5bfd3417fc5de81d3794c3e443cfe in cytoplasm-0.1.4
- old
+ new
@@ -1,8 +1,8 @@
-o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1356306315.3340201:@value"³K{I"
+o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1357576208.274899:@value"íP{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"cytoplasm/cytoSelect.js; FI"
pathname; FI"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSelect.js.erb; FI"content_type; FI"application/javascript; FI"
-mtime; FI"2012-12-23T18:44:31-05:00; FI"length; Fi]HI"digest; F"%f38a823654abf3a9dd3cae15939b212dI"source; FI"]H// CytoSelect v3.0
+mtime; FI"2013-01-07T11:30:08-05:00; FI"length; Fi—MI"digest; F"%0fd3349e4fd3e1d23e3a6bdcd361ccd0I"source; FI"—M// CytoSelect v3.0
// By MacKinley Smith
(function($){
var defaults = {
widget:{
arrowButton:{
@@ -78,11 +78,11 @@
'text-overflow':'ellipsis',
'white-space':'nowrap',
'box-shadow':'inset 0px 0px 5px rgba(0,0,0,0.5)'
},
hover:function(cy,e){
- $(this).css({background:'hsl(167,51%,30%)'});
+ $(this).css({background:'#aaff7f'});
},
unhover:function(cy,e){
$(this).css({background:'transparent'});
}
},
@@ -140,51 +140,63 @@
$this.data('tabindex',$this.attr('tabindex')).attr('tabindex',-1).hide();
// Cosmetic Fixes
//if (/chrome/.test(navigator.userAgent.toLowerCase())) settings.widget.arrowButton.element.css({top:-1});
- $this.data('cytoSelect',settings);
-
// Bindings
- settings.widget.valueButton.element.bind({
- "click.cytoSelect":function(e){
- e.preventDefault();
- if (settings.widget.optionsList.element.is(':visible')) methods.hideMenu.apply($this)
- else methods.showMenu.apply($this);
+ settings.bindings = {
+ select:{
+ "change.cytoSelect":function(e){
+ settings.widget.optionsList.li.elements.filter('.active').removeClass('active');
+ var active = settings.widget.optionsList.li.elements.filter('[data-value="'+$(this).val()+'"]').addClass('active');
+ settings.widget.valueButton.element.html(active.html());
+ settings.events.change.apply($this,[settings,e]);
+ }
},
- "keydown.cytoSelect":function(e){
- if (settings.widget.optionsList.element.is(':visible') || (e.which != 38 && e.which != 40)) return true;
- e.preventDefault();
- var current = settings.widget.optionsList.element.find('li.active');
- $this.val(((e.which == 38) ? ((!current.is(':first-child')) ? current.prev() : current.siblings(':last-child')) : ((!current.is(':last-child')) ? current.next() : current.siblings(':first-child'))).data('value')).trigger('change.cytoSelect');
- }
- });
- settings.widget.arrowButton.element.bind("click.cytoSelect",function(e){
- e.preventDefault();
- if (settings.widget.optionsList.element.is(':visible')) methods.hideMenu.apply($this)
- else methods.showMenu.apply($this);
- });
- $this.bind("change.cytoSelect",function(e){
- settings.widget.optionsList.li.elements.filter('.active').removeClass('active');
- var active = settings.widget.optionsList.li.elements.filter('[data-value="'+$(this).val()+'"]').addClass('active');
- settings.widget.valueButton.element.html(active.html());
- settings.events.change.apply($this,[settings,e]);
- });
- settings.widget.optionsList.element.bind({
- 'mouseout.cytoSelect':function(e){$(this).find('.active').trigger('mouseover');}
- });
- settings.widget.optionsList.li.elements.bind({
- 'click.cytoSelect':function(e){
- e.preventDefault();
- $(this).siblings('.active').removeClass('active').trigger("mouseout");
- $(this).addClass('active');
- methods.hideMenu.apply($this);
- settings.events.change.apply($this,[settings,e]);
+ valueButton:{
+ "click.cytoSelect":function(e){
+ e.preventDefault();
+ if (settings.widget.optionsList.element.is(':visible')) methods.hideMenu.apply($this)
+ else methods.showMenu.apply($this);
+ },
+ "keydown.cytoSelect":function(e){
+ if (settings.widget.optionsList.element.is(':visible') || (e.which != 38 && e.which != 40)) return true;
+ e.preventDefault();
+ var current = settings.widget.optionsList.element.find('li.active');
+ $this.val(((e.which == 38) ? ((!current.is(':first-child')) ? current.prev() : current.siblings(':last-child')) : ((!current.is(':last-child')) ? current.next() : current.siblings(':first-child'))).data('value')).trigger('change.cytoSelect');
+ }
},
- 'mouseover.cytoSelect':function(e){settings.widget.optionsList.li.hover.apply($(this),[settings,e]);},
- 'mouseout.cytoSelect':function(e){settings.widget.optionsList.li.unhover.apply($(this),[settings,e]);}
- });
+ arrowButton:{
+ "click.cytoSelect":function(e){
+ e.preventDefault();
+ if (settings.widget.optionsList.element.is(':visible')) methods.hideMenu.apply($this)
+ else methods.showMenu.apply($this);
+ }
+ },
+ optionsList:{
+ 'mouseout.cytoSelect':function(e){$(this).find('.active').trigger('mouseover');}
+ },
+ optionsListLi:{
+ 'click.cytoSelect':function(e){
+ e.preventDefault();
+ $(this).siblings('.active').removeClass('active').trigger("mouseout");
+ $(this).addClass('active');
+ methods.hideMenu.apply($this);
+ settings.events.change.apply($this,[settings,e]);
+ },
+ 'mouseover.cytoSelect':function(e){settings.widget.optionsList.li.hover.apply($(this),[settings,e]);},
+ 'mouseout.cytoSelect':function(e){settings.widget.optionsList.li.unhover.apply($(this),[settings,e]);}
+ }
+ };
+ $this.data('cytoSelect',settings);
+ settings.widget.valueButton.element.bind(settings.bindings.valueButton);
+ settings.widget.arrowButton.element.bind(settings.bindings.arrowButton);
+ $this.bind(settings.bindings.select);
+ settings.widget.optionsList.element.bind(settings.bindings.optionsList);
+ settings.widget.optionsList.li.elements.bind(settings.bindings.optionsListLi);
+
+ // Account for optionsList scrollbar
if (settings.widget.optionsList.maxHeight <= settings.widget.optionsList.element.height()) settings.widget.optionsList.element.css({'overflow-y':'scroll',height:settings.widget.optionsList.maxHeight,'border-top':'none','border-right-color':'#bbb','border-bottom':'none'});
$this.data({'cytoSelect':settings,'cytoSelect-toggled':0});
methods.resize.apply($this);
settings.events.create.apply($this,[settings]);
@@ -192,35 +204,50 @@
},
hideMenu:function(){
return this.each(function(){
var $this = $(this).data('cytoSelect-toggled',0);
var settings = $this.data('cytoSelect');
+ if (settings==null) return console.warn("You must instanciate $.cytoSelect before calling the hideMenu method!");
var active = settings.widget.optionsList.element.find('.active');
$(document).unbind(".cytoSelect-menu");
$this.val(active.data('value'));
settings.widget.optionsList.element.hide("slide",{direction:'up'},settings.widget.optionsList.animationSpeed,function(){
- settings.widget.valueButton.element.html(active.html()).css({'border-bottom-left-radius':3,'box-shadow':'none'});
+ settings.widget.valueButton.element.html(active.html()).css('border-bottom-left-radius',3).removeClass('active');
settings.widget.arrowButton.element.css('border-bottom-right-radius',3);
settings.widget.arrowButton.img.element.attr('src',settings.widget.arrowButton.img.down);
+ $(this).appendTo(settings.widget.wrapper.element);
+ settings.widget.valueButton.element.unbind('.cytoSelect').bind(settings.bindings.valueButton);
+ settings.widget.arrowButton.element.unbind('.cytoSelect').bind(settings.bindings.arrowButton);
});
});
},
showMenu:function(){
return this.each(function(){
var $this = $(this).data('cytoSelect-toggled',1);
var settings = $this.data('cytoSelect');
+ if (settings==null) return console.warn("You must instanciate $.cytoSelect before calling the showMenu method!");
var active = settings.widget.optionsList.element.find('.active');
// Skip if there aren't any list elements to show
if (!settings.widget.optionsList.li.elements.length) return false;
+ settings.widget.valueButton.element.unbind('.cytoSelect').bind("click.cytoSelect",function(e){e.preventDefault();});
+ settings.widget.arrowButton.element.unbind('.cytoSelect').bind("click.cytoSelect",function(e){e.preventDefault();});
+
+ // Move optionsList outside of wrapper
+ var offset = settings.widget.valueButton.element.offset();
+ settings.widget.optionsList.element.prependTo($('body')).css({
+ top:offset.top + settings.widget.valueButton.element.outerHeight(),
+ left:offset.left
+ });
+
// Cosmetic changes
- settings.widget.valueButton.element.css({'border-bottom-left-radius':0,'box-shadow':'inset 0px 0px 5px black'});
+ settings.widget.valueButton.element.css('border-bottom-left-radius',0).addClass('active');
settings.widget.arrowButton.element.css('border-bottom-right-radius',0);
settings.widget.arrowButton.img.element.attr('src',settings.widget.arrowButton.img.up);
settings.widget.optionsList.element.show("slide",{direction:'up'},settings.widget.optionsList.animationSpeed,function(){
// Fix hovering states
@@ -365,11 +392,11 @@
return this.each(function(){
var $this = $(this);
var settings = $this.data('cytoSelect');
if (!$this.hasClass('cytoSelect') || settings==null) return console.warn("You must instanciate $.cytoSelect before calling the clear method!");
- $this.children('option').not("[value=''],[value='0']").remove();
+ $this.children('option').remove();
if (refresh) methods.refresh.apply($this);
});
},
value:function(set){
if (set==null || set==undefined) set = false;
@@ -412,7 +439,7 @@
};
$(window).resize(function(){$('select.cytoSelect').cytoSelect("resize");});
$.Cytoplasm("ready",function(){$('select.cytoSelect').cytoSelect();});
})(jQuery);
-; FI"dependency_digest; F"%922272dc01a9839edfd2389ac51ff537I"required_paths; F[I"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSelect.js.erb; FI"dependency_paths; F[{I" path; FI"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSelect.js.erb; FI"
-mtime; FI"2012-12-23T18:44:31-05:00; FI"digest; F"%8351944d2d20aa512cedbe961f393a56I"
_version; F"%6776f581a4329e299531e1d52aa59832
+; FI"dependency_digest; F"%f2d3de88dacb40f9bd921c446efa9148I"required_paths; F[I"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSelect.js.erb; FI"dependency_paths; F[{I" path; FI"g/Applications/XAMPP/xamppfiles/htdocs/cytoplasm/app/assets/javascripts/cytoplasm/cytoSelect.js.erb; FI"
+mtime; FI"2013-01-07T11:30:08-05:00; FI"digest; F"%11e256e56c45fd82d6e4a09b1523d1daI"
_version; F"%6776f581a4329e299531e1d52aa59832
\ No newline at end of file