Update chosen to latest version and use latest version of jQuery
This commit is contained in:
parent
9cd2fcbb3a
commit
31a708028d
|
@ -303,6 +303,15 @@
|
|||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Disabled Support */
|
||||
.chzn-disabled {
|
||||
cursor: default;
|
||||
opacity:0.5 !important;
|
||||
}
|
||||
.chzn-disabled .chzn-single {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* @group Right to Left */
|
||||
.chzn-rtl { direction:rtl;text-align: right; }
|
||||
.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; }
|
||||
|
|
|
@ -44,6 +44,9 @@
|
|||
this.click_test_action = __bind(function(evt) {
|
||||
return this.test_active_click(evt);
|
||||
}, this);
|
||||
this.activate_action = __bind(function(evt) {
|
||||
return this.activate_field(evt);
|
||||
}, this);
|
||||
this.active_field = false;
|
||||
this.mouse_on_container = false;
|
||||
this.results_showing = false;
|
||||
|
@ -134,13 +137,26 @@
|
|||
return this.search_field.focus(__bind(function(evt) {
|
||||
return this.input_focus(evt);
|
||||
}, this));
|
||||
}
|
||||
};
|
||||
Chosen.prototype.search_field_disabled = function() {
|
||||
this.is_disabled = this.form_field_jq.attr('disabled');
|
||||
if (this.is_disabled) {
|
||||
this.container.addClass('chzn-disabled');
|
||||
this.search_field.attr('disabled', true);
|
||||
if (!this.is_multiple) {
|
||||
return this.selected_item.unbind("focus", this.activate_action);
|
||||
}
|
||||
} else {
|
||||
return this.selected_item.focus(__bind(function(evt) {
|
||||
return this.activate_field(evt);
|
||||
}, this));
|
||||
this.container.removeClass('chzn-disabled');
|
||||
this.search_field.attr('disabled', false);
|
||||
if (!this.is_multiple) {
|
||||
return this.selected_item.bind("focus", this.activate_action);
|
||||
}
|
||||
}
|
||||
};
|
||||
Chosen.prototype.container_mousedown = function(evt) {
|
||||
if (!this.is_disabled) {
|
||||
if (evt && evt.type === "mousedown") {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
|
@ -159,6 +175,7 @@
|
|||
} else {
|
||||
return this.pending_destroy_click = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
Chosen.prototype.mouse_enter = function() {
|
||||
return this.mouse_on_container = true;
|
||||
|
@ -243,6 +260,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
this.search_field_disabled();
|
||||
this.show_search_field_default();
|
||||
this.search_field_scale();
|
||||
this.search_results.html(content);
|
||||
|
|
|
@ -1288,7 +1288,7 @@
|
|||
</footer>
|
||||
|
||||
</div>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="chosen/chosen.jquery.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(".chzn-select").chosen();
|
||||
|
|
Loading…
Reference in a new issue