From e0f739cfea4a99623e8888c5b47dffdff5f28c01 Mon Sep 17 00:00:00 2001 From: sim2github Date: Mon, 11 Aug 2014 01:31:34 +0300 Subject: [PATCH] Insert buttons support --- cms/templates/admin/subtemplates/edit.inc.tpl | 6 +++--- static/js/admin_backend.js | 12 +----------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/cms/templates/admin/subtemplates/edit.inc.tpl b/cms/templates/admin/subtemplates/edit.inc.tpl index 9686e83..cf20cbd 100644 --- a/cms/templates/admin/subtemplates/edit.inc.tpl +++ b/cms/templates/admin/subtemplates/edit.inc.tpl @@ -88,15 +88,15 @@
diff --git a/static/js/admin_backend.js b/static/js/admin_backend.js index d46eb1d..33cb656 100644 --- a/static/js/admin_backend.js +++ b/static/js/admin_backend.js @@ -1,16 +1,6 @@ $.fn.extend({ insertAtCaret: function(myValue){ -var obj; -if( typeof this[0].name !='undefined' ) obj = this[0]; -else obj = this; -var startPos = obj.selectionStart; -var endPos = obj.selectionEnd; -var scrollTop = obj.scrollTop; -obj.value = obj.value.substring(0, startPos)+myValue+obj.value.substring(endPos,obj.value.length); -obj.focus(); -obj.selectionStart = startPos + myValue.length; -obj.selectionEnd = startPos + myValue.length; -obj.scrollTop = scrollTop; +editor.insert(myValue); } });