mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Editable: use execCommand to selectAll, if supported
This commit is contained in:
parent
121b134db9
commit
691c539ca6
2
dist/js/widgets/widget-editable.min.js
vendored
2
dist/js/widgets/widget-editable.min.js
vendored
File diff suppressed because one or more lines are too long
@ -27,6 +27,9 @@
|
||||
|
||||
selectAll: function( cell ) {
|
||||
setTimeout( function() {
|
||||
if ( document.queryCommandSupported( 'SelectAll' ) ) {
|
||||
document.execCommand( 'selectAll', false, null );
|
||||
} else {
|
||||
// select all text in contenteditable
|
||||
// see http://stackoverflow.com/a/6150060/145346
|
||||
var range, selection;
|
||||
@ -41,6 +44,8 @@
|
||||
selection.removeAllRanges();
|
||||
selection.addRange( range );
|
||||
}
|
||||
}
|
||||
// need delay of at least 100ms or last contenteditable will get refocused
|
||||
}, 100 );
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user