Skip to content

Commit

Permalink
Prepare release of v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcojakob committed Jun 26, 2013
1 parent d17474e commit 7fbbe0f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ Changelog
* More stable handling of nested elements. Instead of keeping track of
dragOverElements in a list, the related target of the event is used to
determine if it is an event that happened on the main element or bubbled
up from child elements.
up from child elements.

## Version 0.3.1 (2013-06-26) ##
* Touch Event support (Issue #3): Uses touchStart, touchMove, and touchEnd
events to emulate HTML5 drag and drop behaviour.
* Reorganized some parts. Now only html5_dnd.dart needs to be imported and
sortable is imported automatically. If some functionality like sortable isn't
used, Dart's treeshaking will make sure no unnecessary code is added.
* Add extended usage documentation to readme.
29 changes: 26 additions & 3 deletions example/html5_dnd_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ main() {
// Logger.root.onRecord.listen(new PrintHandler().call);
// Logger.root.level = Level.FINEST;

// Enable touch support.
enableTouchEvents = true;

// Install Drag and Drop examples.
sectionDraggableAndDropzone();
sectionDraggingDivs();
Expand All @@ -28,8 +25,12 @@ main() {
sectionSortableListExclude();
sectionSortableListHandles();
sectionSortableTwoGroups();

// Used for the code examples on the blog website.
// _installCodeblockTabs();
}


sectionDraggableAndDropzone() {
// Install draggables (documents).
DraggableGroup dragGroup = new DraggableGroup()
Expand Down Expand Up @@ -203,4 +204,26 @@ sectionSortableTwoGroups() {
// Only accept elements from this section.
sortGroup1.accept.addAll([sortGroup1, sortGroup2]);
sortGroup2.accept.addAll([sortGroup1, sortGroup2]);
}


_installCodeblockTabs() {
List<AnchorElement> tabLinks = queryAll('.example-code .menu li a');
for (AnchorElement link in tabLinks) {
link.onClick.listen((MouseEvent event) {
event.preventDefault();

Element exampleCodeParent = link.parent.parent.parent;

// Remove active class on all menu and content tabs.
exampleCodeParent.queryAll('[tab]').forEach((Element e) {
e.classes.remove('active');
});

// Add active class.
String currentTab = link.attributes['tab'];
link.classes.add('active');
exampleCodeParent.query('.content [tab="$currentTab"]').classes.add('active');
});
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: html5_dnd
version: 0.3.0
version: 0.3.1
author: Marco Jakob <[email protected]>
description: HTML5 Drag and Drop
homepage: https://github.com/marcojakob/dart-html5-dnd
Expand Down

0 comments on commit 7fbbe0f

Please sign in to comment.