Skip to content

Commit

Permalink
bump version to 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Oppermann committed Aug 7, 2015
1 parent 187030f commit 61c130a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html.sortable",
"version": "0.2.9",
"version": "0.3.0",
"repository": {
"type": "git",
"url": "https://github.com/voidberg/html5sortable.git"
Expand Down
24 changes: 20 additions & 4 deletions dist/html.sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ var _enableSortable = function(sortable) {
// IE FIX for ghost
// can be disabled as it has the side effect that other events
// (e.g. click) will be ignored
if (typeof document.createElement('span').dragDrop === 'function' && !opts.disableIEFix) {
var spanEl = (document || window.document).createElement('span');
if (typeof spanEl.dragDrop === 'function' && !opts.disableIEFix) {
handles.on('mousedown.h5s', function() {
if (items.index(this) !== -1) {
this.dragDrop();
Expand Down Expand Up @@ -227,7 +228,8 @@ var sortable = function(selector, options) {
dragImage: null,
disableIEFix: false,
placeholderClass: 'sortable-placeholder',
draggingClass: 'sortable-dragging'
draggingClass: 'sortable-dragging',
hoverClass: false
}, options);

/* TODO: maxstatements should be 25, fix and remove line below */
Expand Down Expand Up @@ -271,6 +273,20 @@ var sortable = function(selector, options) {
items.attr('role', 'option');
items.attr('aria-grabbed', 'false');

// Mouse over class
if (options.hoverClass) {
var hoverClass = 'sortable-over';
if (typeof options.hoverClass === 'string') {
hoverClass = options.hoverClass;
}

items.hover(function() {
$(this).addClass(hoverClass);
}, function() {
$(this).removeClass(hoverClass);
});
}

// Handle drag events on draggable items
items.on('dragstart.h5s', function(e) {
e.stopImmediatePropagation();
Expand Down Expand Up @@ -298,6 +314,7 @@ var sortable = function(selector, options) {
// trigger sortstar update
dragging.parent().triggerHandler('sortstart', {
item: dragging,
placeholder: placeholder,
startparent: startParent
});
});
Expand Down Expand Up @@ -346,8 +363,7 @@ var sortable = function(selector, options) {
});

// Handle dragover and dragenter events on draggable items
// TODO: REMOVE placeholder?????
items.add([this, placeholder]).on('dragover.h5s dragenter.h5s', function(e) {
items.add([this]).on('dragover.h5s dragenter.h5s', function(e) {
if (!_listsConnected($sortable, $(dragging).parent())) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/html.sortable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 61c130a

Please sign in to comment.