Permalink
Browse files

- initTables method exposed as public (needed for cases when table is

dynamically added or removed)
- from now lib uses querySelectorAll for tables and div selection
(here is compatibility table http://caniuse.com/queryselector)
- enableDrag uses CSS selector
  • Loading branch information...
1 parent 0a3728f commit 718da19b86330373aba439eb80ea7cc2d95a5ea6 @dbunic committed Oct 31, 2012
Showing with 201 additions and 178 deletions.
  1. +3 −0 changes.txt
  2. +2 −2 example00/script.js
  3. +3 −3 example17/script.js
  4. +2 −2 example18/script1.js
  5. +1 −0 readme.md
  6. +54 −54 redips-drag-min.js
  7. +136 −117 redips-drag-source.js
View
@@ -4,6 +4,9 @@ Changes for REDIPS.drag library
- big code cleaning
- majority of properties, methods and event handlers are renamed (camelCase syntax is used)
- added option to set delete confirmation question (for deleting DIV element and row)
+- initTables method exposed as public (needed for cases when table is dynamically added or removed)
+- from now lib uses querySelectorAll for tables and div selection (here is compatibility table http://caniuse.com/queryselector)
+- enableDrag uses CSS selector
4.7.6
- added event handler myhandler_relocated() - event can be triggered after single call of relocate() method or after all DIV elements are shifted in "shift" mode
View
@@ -31,8 +31,8 @@ redips.load_table = function (button) {
success: function (result) {
// load new table
$('#load_content').html(result);
- // run REDIPS.drag initialization
- REDIPS.drag.init();
+ // rescan tables
+ REDIPS.drag.initTables();
}
});
};
View
@@ -218,8 +218,8 @@ getId = function (el) {
* @param {Boolean} Flag enable or disable elements in both dragging containers.
*/
enableElements = function (flag) {
- rd.enableDrag(flag, 'drag1', 'subtree');
- rd.enableDrag(flag, 'drag2', 'subtree');
+ rd.enableDrag(flag, '#drag1 div');
+ rd.enableDrag(flag, '#drag2 div');
// enable/disable buttons "Reset" and "Shuffle"
enableButtons(flag);
};
@@ -252,7 +252,7 @@ enableRows = function (flag) {
// test the property (filter properties of the prototype) and if element id begins with "r"
// other DIV elements are DIV elements
if (loc.hasOwnProperty(id) && id.substring(0, 1) === 'r') {
- rd.enableDrag(flag, id);
+ rd.enableDrag(flag, '#' + id);
}
}
}
View
@@ -84,8 +84,8 @@ redips.buttonEnable = function (flag) {
// enable/disable button (reference is set in redips.init)
redips.button1.disabled = !flag;
redips.button2.disabled = !flag;
- // enable/disable DIV elements in dragging container
- REDIPS.drag.enableDrag(flag, 'drag', 'subtree');
+ // enable/disable DIV elements in drag container
+ REDIPS.drag.enableDrag(flag);
};
View
@@ -33,6 +33,7 @@ REDIPS.drag is a JavaScript drag and drop library focused on dragging table cont
## Public methods
* REDIPS.drag.init() - drag container initialization
+* REDIPS.drag.initTables() - tables layout initialization
* REDIPS.drag.cloneObject() - clones DIV element and returns reference of the cloned element
* REDIPS.drag.deleteObject() - method deletes DIV element (input parameter is DIV reference or element id)
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 718da19

Please sign in to comment.