summaryrefslogtreecommitdiff
path: root/lib/scripts/edit.js
diff options
context:
space:
mode:
authorSzymon Olewniczak <szymon.olewniczak@rid.pl>2014-02-07 17:59:24 +0100
committerSzymon Olewniczak <szymon.olewniczak@rid.pl>2014-02-07 17:59:24 +0100
commit8af71b8cc80c9e5a62803443c04acd24ba725e42 (patch)
tree70dcdff3b8b68444c131877629bce364466479f5 /lib/scripts/edit.js
parent2bc9e7932fca7046e932dc3722bc3f949e086e94 (diff)
downloadrpg-8af71b8cc80c9e5a62803443c04acd24ba725e42.tar.gz
rpg-8af71b8cc80c9e5a62803443c04acd24ba725e42.tar.bz2
add preventDefault to toolbar buttons
Diffstat (limited to 'lib/scripts/edit.js')
-rw-r--r--lib/scripts/edit.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js
index 56c185db7..2400103e1 100644
--- a/lib/scripts/edit.js
+++ b/lib/scripts/edit.js
@@ -134,7 +134,10 @@ function pickerInsert(text,edid){
*/
function addBtnActionSignature($btn, props, edid) {
if(typeof SIG != 'undefined' && SIG != ''){
- $btn.bind('click', bind(insertAtCarret,edid,SIG));
+ $btn.bind('click', function (e) {
+ insertAtCarret(edid,SIG);
+ e.preventDefault();
+ });
return edid;
}
return '';
@@ -148,7 +151,7 @@ function addBtnActionSignature($btn, props, edid) {
function currentHeadlineLevel(textboxId){
var field = jQuery('#' + textboxId)[0],
s = false,
- opts = [field.value.substr(0,DWgetSelection(field).start)];
+ opts = [field.value.substr(0,getSelection(field).start)];
if (field.form.prefix) {
// we need to look in prefix context
opts.push(field.form.prefix.value);
@@ -217,10 +220,10 @@ jQuery(function () {
}
// set focus and place cursor at the start
- var sel = DWgetSelection($edit_text[0]);
+ var sel = getSelection($edit_text[0]);
sel.start = 0;
sel.end = 0;
- DWsetSelection(sel);
+ setSelection(sel);
$edit_text.focus();
}