Make the prototype version more like the jQuery version (doesn't sniff for a class any longer)
This commit is contained in:
parent
800e3d5502
commit
a7a8ad54e2
|
@ -700,19 +700,6 @@
|
||||||
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
|
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.observe('dom:loaded', function(evt) {
|
|
||||||
var select, selects, _i, _len, _results;
|
|
||||||
if (Prototype.Browser.IE && (Prototype.BrowserFeatures['Version'] === 6 || Prototype.BrowserFeatures['Version'] === 7)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
selects = $$(".chzn-select");
|
|
||||||
_results = [];
|
|
||||||
for (_i = 0, _len = selects.length; _i < _len; _i++) {
|
|
||||||
select = selects[_i];
|
|
||||||
_results.push(new Chosen(select));
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
});
|
|
||||||
get_side_border_padding = function(elmt) {
|
get_side_border_padding = function(elmt) {
|
||||||
var layout, side_border_padding;
|
var layout, side_border_padding;
|
||||||
layout = new Element.Layout(elmt);
|
layout = new Element.Layout(elmt);
|
||||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -584,13 +584,6 @@ if Prototype.Browser.IE
|
||||||
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
|
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
|
||||||
|
|
||||||
|
|
||||||
document.observe 'dom:loaded', (evt) ->
|
|
||||||
# Do no harm and return as soon as possible for unsupported browsers, namely IE6 and IE7
|
|
||||||
return if Prototype.Browser.IE and (Prototype.BrowserFeatures['Version'] is 6 or Prototype.BrowserFeatures['Version'] is 7)
|
|
||||||
|
|
||||||
selects = $$(".chzn-select")
|
|
||||||
new Chosen select for select in selects
|
|
||||||
|
|
||||||
get_side_border_padding = (elmt) ->
|
get_side_border_padding = (elmt) ->
|
||||||
layout = new Element.Layout(elmt)
|
layout = new Element.Layout(elmt)
|
||||||
side_border_padding = layout.get("border-left") + layout.get("border-right") + layout.get("padding-left") + layout.get("padding-right")
|
side_border_padding = layout.get("border-left") + layout.get("border-right") + layout.get("padding-left") + layout.get("padding-right")
|
||||||
|
|
17
example.html
17
example.html
|
@ -1263,11 +1263,26 @@
|
||||||
<p>Using Chosen is easy as can be.</p>
|
<p>Using Chosen is easy as can be.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Download the plugin and copy the chosen files to your app.</li>
|
<li>Download the plugin and copy the chosen files to your app.</li>
|
||||||
<li>Add the class <em>chzn-select</em> to any select box.</li>
|
<li>Activate the plugin by creating a new instance of Chosen: New Chosen(<em>some_form_field</em>);</li>
|
||||||
<li><a href="http://youtu.be/pS-RsIzb78U?t=57s">Disco</a>.</li>
|
<li><a href="http://youtu.be/pS-RsIzb78U?t=57s">Disco</a>.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js" type="text/javascript"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js" type="text/javascript"></script>
|
||||||
<script src="chosen/chosen.proto.js" type="text/javascript"></script>
|
<script src="chosen/chosen.proto.js" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.observe('dom:loaded', function(evt) {
|
||||||
|
var select, selects, _i, _len, _results;
|
||||||
|
if (Prototype.Browser.IE && (Prototype.BrowserFeatures['Version'] === 6 || Prototype.BrowserFeatures['Version'] === 7)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selects = $$(".chzn-select");
|
||||||
|
_results = [];
|
||||||
|
for (_i = 0, _len = selects.length; _i < _len; _i++) {
|
||||||
|
select = selects[_i];
|
||||||
|
_results.push(new Chosen(select));
|
||||||
|
}
|
||||||
|
return _results;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in a new issue