r3171 committed - selectable refactor: added ui-selectble-item instead of ui-state-defau...
Revision: 3171
Author: rdworth
Date: Fri Aug 28 05:59:46 2009
Log: selectable refactor: added ui-selectble-item instead of
ui-state-default, added ui-selected in addition to ui-state-active, fixed
theme to have transparent 1px border for ui-selectable-item to match border
width that ui-state-(active/hover/focus) add
http://code.google.com/p/jquery-ui/source/detail?r=3171
Modified:
/branches/dev/selectable/tests/static/selectable/default.html
/branches/dev/selectable/tests/visual/selectable/colors.css
/branches/dev/selectable/themes/base/ui.selectable.css
/branches/dev/selectable/ui/ui.selectable.js
=======================================
--- /branches/dev/selectable/tests/static/selectable/default.html Thu Aug
27 10:04:41 2009
+++ /branches/dev/selectable/tests/static/selectable/default.html Fri Aug
28 05:59:46 2009
@@ -23,12 +23,6 @@
margin: 2px;
width: 200px;
}
-
- /* Widget styles - should be added to ui.selectable.css */
- .ui-selectable-item {
- border: 1px dashed transparent;
- padding: .2em .3em;
- }
</style>
</head>
<body>
=======================================
--- /branches/dev/selectable/tests/visual/selectable/colors.css Wed Aug 26
00:44:09 2009
+++ /branches/dev/selectable/tests/visual/selectable/colors.css Fri Aug 28
05:59:46 2009
@@ -1,11 +1,6 @@
-.sellist li { border: 1px solid silver; }
.sellist .ui-state-active { border: 1px solid gray; background: silver; }
-.selgrid li { border: 1px solid silver; }
.selgrid .ui-state-active { background: #ad7fa8; border-color: #5c3566;
color: white; }
-.seltable thead th, .seltable tfoot th { border: 1px solid silver; }
.seltable thead .ui-state-active, .seltable tfoot .ui-state-active {
background: #8ae234; border-color: #4e9a06; }
-.seltable tbody td { border: 1px solid silver; }
.seltable tbody .ui-state-active { border: 1px solid gray; background:
#729fcf; border-color: #204a87; color: white; }
-.largegrid li { border: 1px solid silver; }
.largegrid .ui-state-active { background: #e9b96e; border-color: #8f5902; }
.ui-state-focus { background: #fcaf3e !important; }
=======================================
--- /branches/dev/selectable/themes/base/ui.selectable.css Wed Aug 26
03:38:55 2009
+++ /branches/dev/selectable/themes/base/ui.selectable.css Fri Aug 28
05:59:46 2009
@@ -1,1 +1,2 @@
+.ui-selectable-item { border: 1px dashed transparent; padding: .2em .3em; }
.ui-selectable-lasso { border: 1px solid rgb(50, 50, 50); background:
rgba(100, 100, 100, 0.2); }
=======================================
--- /branches/dev/selectable/ui/ui.selectable.js Fri Aug 28 05:45:47 2009
+++ /branches/dev/selectable/ui/ui.selectable.js Fri Aug 28 05:59:46 2009
@@ -52,7 +52,7 @@
// If item is part of current selection and current
// selection is multiple, return and allow mouseup
// to fire (Windows gets this right too, OSX doesn't)
- if(self._selection.length > 1 &&
$(item).hasClass(self.options.selectedClass)) {
+ if(self._selection.length > 1 && $(item).hasClass('ui-selected')) {
return (self._listenForMouseUp = 1);
}
@@ -187,7 +187,7 @@
},
destroy: function() {
- this.items.removeClass("ui-selected ui-state-default ui-state-active");
+ this.items.removeClass("ui-selectable-item ui-selected
ui-state-active");
this.element
.removeClass("ui-selectable ui-selectable-disabled ui-widget")
.removeData("selectable")
@@ -367,7 +367,7 @@
for (var i = this._selection.length - 1; i >= 0; i--){
if(triggerEvent &&
this._selection[i].data('selectable-item').selected)
triggerItems.push(this._selection[i]);
- this._selection[i].removeClass(this.options.selectedClass);
+ this._selection[i].removeClass('ui-selected ui-state-active');
this._selection[i].data('selectable-item').selected = false;
};
@@ -390,7 +390,7 @@
this._selection.push(item);
this.latestSelection = item;
- item.addClass(this.options.selectedClass);
+ item.addClass('ui-selected ui-state-active');
item.data('selectable-item').selected = true;
if(triggerEvent) {
@@ -405,7 +405,7 @@
for (var i=0; i < this._selection.length; i++) {
if (this._selection[i][0] == item[0]) {
- this._selection[i].removeClass(this.options.selectedClass);
+ this._selection[i].removeClass('ui-selected ui-state-active');
this._selection[i].data('selectable-item').selected = false;
this._selection.splice(i,1);
if(triggerEvent) this._trigger('deselect', triggerEvent,
this._uiHash($(item), 'removed'));
@@ -542,7 +542,7 @@
var o = this.options, self = this;
this.items = $(o.filter, this.element);
- this.items.addClass('ui-state-default');
+ this.items.addClass('ui-selectable-item');
this.items.each(function() {
var $this = $(this);
@@ -557,7 +557,7 @@
right: pos.left + $this.width(),
bottom: pos.top + $this.height(),
startSelected: false,
- selected: $this.hasClass(o.selectedClass)
+ selected: $this.hasClass('ui-selected')
});
});
@@ -653,10 +653,7 @@
distance: 1,
tolerance: 'touch',
appendTo: 'body'
- },
-
- //Should we really delete that?
- selectedClass: 'ui-state-active'
+ }
}
});