jquery升级到3.5.1

This commit is contained in:
吴方海
2025-05-19 13:45:19 +08:00
parent 5c2676afc7
commit 43ab6d2e85
8 changed files with 28 additions and 27 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
{
"outputFileName": "wwwroot/Statics/bundles/jquery.js",
"inputFiles": [
"wwwroot/Statics/libs/jquery/jquery-3.4.1.min.js",
"wwwroot/Statics/libs/jquery/jquery-3.5.1.min.js",
"wwwroot/Statics/libs/v1/jquery.ui.datepicker-zh-CN.js",
"wwwroot/Statics/libs/v1/jquery-ui/jquery-ui.min.js",
"wwwroot/Statics/libs/chosen/chosen.jquery.min.js",
+11 -9
View File
@@ -353,12 +353,12 @@ $.widget("ui.multiselect", {
update: function(event, ui) {
// apply the new sort order to the original selectbox
that.selectedList.find('li').each(function() {
if ($(this).data('optionLink'))
$(this).data('optionLink').remove().appendTo(that.element);
if (this._optionLink)
$(this._optionLink).remove().appendTo(that.element);
});
},
receive: function(event, ui) {
ui.item.data('optionLink').prop('selected', true);
$(ui.item.get(0)._optionLink).prop('selected', true);
// increment count
that.count += 1;
that._updateCount();
@@ -423,20 +423,22 @@ $.widget("ui.multiselect", {
},
_getOptionNode: function(option) {
option = $(option);
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
node.data('optionLink', option);
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"></span>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
// 使用jQuery的attr方法存储option引用
node.get(0)._optionLink = option.get(0);
return node;
},
// clones an item with associated data
// didn't find a smarter away around this
_cloneWithData: function(clonee) {
var clone = clonee.clone();
clone.data('optionLink', clonee.data('optionLink'));
clone.data('idx', clonee.data('idx'));
// 复制原始DOM元素的引用
clone.get(0)._optionLink = clonee.get(0)._optionLink;
clone.get(0)._idx = clonee.get(0)._idx;
return clone;
},
_setSelected: function(item, selected) {
item.data('optionLink').prop('selected', selected);
$(item.get(0)._optionLink).prop('selected', selected);
if (selected) {
var selectedItem = this._cloneWithData(item);
@@ -449,7 +451,7 @@ $.widget("ui.multiselect", {
// look for successor based on initial option index
var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
var succ = null, i = item.get(0)._idx, direction = comparator(item, $(items[i]));
// TODO: test needed for dynamic list populating
if ( direction ) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -67,12 +67,12 @@ $.widget("ui.multiselect", {
update: function(event, ui) {
// apply the new sort order to the original selectbox
that.selectedList.find('li').each(function() {
if ($(this).data('optionLink'))
$(this).data('optionLink').remove().appendTo(that.element);
if (this._optionLink)
$(this._optionLink).remove().appendTo(that.element);
});
},
receive: function(event, ui) {
ui.item.data('optionLink').prop('selected', true);
$(ui.item.get(0)._optionLink).prop('selected', true);
// increment count
that.count += 1;
that._updateCount();
@@ -137,20 +137,22 @@ $.widget("ui.multiselect", {
},
_getOptionNode: function(option) {
option = $(option);
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
node.data('optionLink', option);
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"></span>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
// 使用jQuery的attr方法存储option引用
node.get(0)._optionLink = option.get(0);
return node;
},
// clones an item with associated data
// didn't find a smarter away around this
_cloneWithData: function(clonee) {
var clone = clonee.clone();
clone.data('optionLink', clonee.data('optionLink'));
clone.data('idx', clonee.data('idx'));
// 复制原始DOM元素的引用
clone.get(0)._optionLink = clonee.get(0)._optionLink;
clone.get(0)._idx = clonee.get(0)._idx;
return clone;
},
_setSelected: function(item, selected) {
item.data('optionLink').prop('selected', selected);
$(item.get(0)._optionLink).prop('selected', selected);
if (selected) {
var selectedItem = this._cloneWithData(item);
@@ -163,7 +165,7 @@ $.widget("ui.multiselect", {
// look for successor based on initial option index
var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
var succ = null, i = item.get(0)._idx, direction = comparator(item, $(items[i]));
// TODO: test needed for dynamic list populating
if ( direction ) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long