Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Update SelecTable.js
Browse files Browse the repository at this point in the history
added function clear_selection()
  • Loading branch information
c0ff3m4kr committed Sep 4, 2014
1 parent ea8f1e0 commit 94f6dd4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion SelecTable.js
Original file line number Diff line number Diff line change
@@ -21,6 +21,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

function clear_selection(){
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
} else if (document.selection) { // IE?
document.selection.empty();
}
}

var SelecTable = function(table, options)
{
var checkbox, row_i, cb_i;
@@ -221,4 +233,4 @@ SelecTable.prototype.getCheckboxOnclick = function(checkbox)
else
table.unselect(index);
}
}
}

0 comments on commit 94f6dd4

Please sign in to comment.