Skip to content

Commit 7bb01d8

Browse files
committed
Avoid using ES6 in the web view content to support Android 4.x
1 parent b639aed commit 7bb01d8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/editor.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@
818818
*/
819819

820820
function setupTouchEndEnableEditing(editorId) {
821-
$(`#${editorId}`).on('touchend', function(e) {
821+
$('#' + editorId).on('touchend', function(e) {
822822
zss_editor.enabledEditingItems(e);
823823
var clicked = $(e.target);
824824
if (!clicked.hasClass('zs_active')) {
@@ -836,7 +836,7 @@
836836
}
837837

838838
function disableLineBreakIfNecessary(editorId) {
839-
var editor = $(`#${editorId}`);
839+
var editor = $('#' + editorId);
840840
var disableLineBreaks = editor.attr("disableLineBreaks");
841841
if (disableLineBreaks) {
842842
editor.keypress(function(e){ return e.which != 13; });
@@ -864,7 +864,7 @@
864864
}
865865

866866
function clearHtmlIfTextIsEmpty(editorId) {
867-
var $editor = $(`#${editorId}`);
867+
var $editor = $('#' + editorId);
868868

869869
$editor.on('input', function() {
870870
if (!(this.textContent || this.querySelectorAll('img, li').length)) {
@@ -983,7 +983,7 @@
983983
}
984984

985985
function setPlaceholder(editorId, placeholder) {
986-
var editor = $(`#${editorId}`);
986+
var editor = $('#' + editorId);
987987

988988
//set placeHolder
989989
editor.attr("placeholder",placeholder);
@@ -1347,7 +1347,7 @@
13471347
}
13481348

13491349
function setHTML(editorId, html) {
1350-
var editor = $(`#${editorId}`);
1350+
var editor = $('#' + editorId);
13511351
editor.html(html);
13521352
}
13531353

@@ -1516,7 +1516,7 @@
15161516

15171517
}
15181518

1519-
WebViewBridge.send(JSON.stringify({type: 'SELECTION_CHANGE', data: {items}}))
1519+
WebViewBridge.send(JSON.stringify({type: 'SELECTION_CHANGE', data: {items: items}}))
15201520
}
15211521

15221522
zss_editor.focusContent = function() {
@@ -1531,7 +1531,7 @@
15311531

15321532
// the following was taken from http://stackoverflow.com/questions/1125292/how-to-move-cursor-to-end-of-contenteditable-entity/3866442#3866442
15331533
// and ensures we move the cursor to the end of the editor
1534-
var editor = $(`#${editorId}`);
1534+
var editor = $('#' + editorId);
15351535
var range = document.createRange();
15361536
range.selectNodeContents(editor.get(0));
15371537
range.collapse(false);
@@ -1567,7 +1567,7 @@
15671567
}
15681568

15691569
function addFocusEvent(editorId, callbackHandler) {
1570-
var editor = $(`#${editorId}`);
1570+
var editor = $('#' + editorId);
15711571
editor.focus(callbackHandler);
15721572
}
15731573

0 commit comments

Comments
 (0)