Skip to content

Commit

Permalink
Version 5.0.1
Browse files Browse the repository at this point in the history
- "shift" method now takes care about marked cells
- added shift.overflow property with the allowed values: "bunch",
"delete" and "source"
  • Loading branch information
dbunic committed Dec 6, 2012
1 parent 0d9d337 commit 530611b
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 96 deletions.
1 change: 1 addition & 0 deletions changes.txt
Expand Up @@ -2,6 +2,7 @@ Changes for REDIPS.drag library

5.0.1
- "shift" method now takes care about marked cells - thanks to Mark Jacobs
- added shift.overflow property with the allowed values: "bunch", "delete" and "source" - thanks to Mark Jacobs

5.0.0
- big code cleaning
Expand Down
24 changes: 16 additions & 8 deletions example21/index.html
Expand Up @@ -49,7 +49,7 @@
<td class="mark"></td>
<td class="mark"></td>
<td></td>
<td></td>
<td class="mark"></td>
</tr>
<tr>
<td><div class="drag">O</div></td>
Expand Down Expand Up @@ -87,7 +87,7 @@

<div class="mycontrols">
<!-- animation checkbox -->
<input type="checkbox" class="checkbox" onclick="toggleAnimation(this)" title="Enable / disable animation" checked=""/>Animation
<input type="checkbox" class="checkbox" onclick="shiftAnimation(this)" title="Enable / disable animation" checked=""/>Animation
<br/>
<!-- confirm before delete object -->
<input type="checkbox" class="checkbox" onclick="toggleConfirm(this)" title="Show confirm delete dialog"/>Show confirm delete dialog
Expand All @@ -96,22 +96,30 @@
Shift after options:
<br/>
<!-- shift table content when DIV element is dropped to the non empty cell -->
<input type="radio" name="shift_after" class="checkbox" onclick="toggleShiftAfter(this)" value="default" title="Default" checked="true"/>Default - shift content only if DIV element is dropped to the non empty cell
<input type="radio" name="shift_after" class="checkbox" onclick="shiftAfter(this)" value="default" title="Default" checked="true"/>Default - shift content only if DIV element is dropped to the non empty cell
<br/>
<!-- shift after element is deleted checkbox -->
<input type="radio" name="shift_after" class="checkbox" onclick="toggleShiftAfter(this)" value="delete" title="Enable / disable content shifting after element is deleted"/>Delete - same as "default" + shift content after element is deleted
<input type="radio" name="shift_after" class="checkbox" onclick="shiftAfter(this)" value="delete" title="Enable / disable content shifting after element is deleted"/>Delete - same as "default" + shift content after element is deleted
<br/>
<!-- always shift table content -->
<input type="radio" name="shift_after" class="checkbox" onclick="toggleShiftAfter(this)" value="always" title="Always shit table content"/>Always - always shift table content
<input type="radio" name="shift_after" class="checkbox" onclick="shiftAfter(this)" value="always" title="Always shit table content"/>Always - always shift table content
<br/>
<br/>
<!-- shift modes -->
<span class="text">Shift options:</span>
<br/>
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Horizontal1" value="horizontal1" checked="true"/>horizontal 1 - element shift can affect more rows<br/>
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Horizontal1" value="horizontal2"/>horizontal 2 - each row is treated separately<br/>
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Horizontal1" value="vertical1"/>vertical 1 - element shift can affect more columns<br/>
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Horizontal1" value="vertical2"/>vertical 2 - each column is treated separately
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Horizontal2" value="horizontal2"/>horizontal 2 - each row is treated separately<br/>
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Vertical1" value="vertical1"/>vertical 1 - element shift can affect more columns<br/>
<input type="radio" name ="shift_mode" onclick="shiftMode(this)" title="Vertical2" value="vertical2"/>vertical 2 - each column is treated separately
<br/>
<br/>
<!-- overflow -->
<span class="text">Overflow:</span>
<br/>
<input type="radio" name ="shift_overflow" onclick="overflow(this)" title="Overflow - bunch" value="bunch" checked="true"/>bunch - overflowed DIV will stay in last cell (default)<br/>
<input type="radio" name ="shift_overflow" onclick="overflow(this)" title="Overflow - delete" value="delete"/>delete - overflowed DIV will be deleted<br/>
<input type="radio" name ="shift_overflow" onclick="overflow(this)" title="Overflow - source" value="source"/>source - overflowed DIV will me moved to the source TD<br/>
</div>
</div>
</body>
Expand Down
17 changes: 12 additions & 5 deletions example21/script.js
Expand Up @@ -6,8 +6,9 @@

var redipsInit,
shiftMode,
toggleAnimation,
toggleShiftAfter,
overflow,
shiftAnimation,
shiftAfter,
toggleConfirm,
counter = 0;

Expand All @@ -34,20 +35,26 @@ redipsInit = function () {
};


// set shift_mode
// set shift mode
shiftMode = function (radio) {
REDIPS.drag.shift.mode= radio.value;
};


// set overflow
overflow = function (radio) {
REDIPS.drag.shift.overflow = radio.value;
};


// enable / disable animation
toggleAnimation = function (chk) {
shiftAnimation = function (chk) {
REDIPS.drag.animation.shift = chk.checked;
};


// enable / disable shift after element is deleted
toggleShiftAfter = function (chk) {
shiftAfter = function (chk) {
REDIPS.drag.shift.after = chk.value;
};

Expand Down

0 comments on commit 530611b

Please sign in to comment.