Просмотр исходного кода

Avoid using ES6 in the web view content to support Android 4.x

Yevhen Pavliuk 8 лет назад
Родитель
Сommit
7bb01d8439
1 измененных файлов: 8 добавлений и 8 удалений
  1. 8
    8
      src/editor.html

+ 8
- 8
src/editor.html Просмотреть файл

@@ -818,7 +818,7 @@
818 818
 			 */
819 819
 
820 820
 			function setupTouchEndEnableEditing(editorId) {
821
-				$(`#${editorId}`).on('touchend', function(e) {
821
+				$('#' + editorId).on('touchend', function(e) {
822 822
 					zss_editor.enabledEditingItems(e);
823 823
 					var clicked = $(e.target);
824 824
 					if (!clicked.hasClass('zs_active')) {
@@ -836,7 +836,7 @@
836 836
 			}
837 837
 
838 838
 			function disableLineBreakIfNecessary(editorId) {
839
-				var editor = $(`#${editorId}`);
839
+				var editor = $('#' + editorId);
840 840
 				var disableLineBreaks = editor.attr("disableLineBreaks");
841 841
 				if (disableLineBreaks) {
842 842
 					editor.keypress(function(e){ return e.which != 13; });
@@ -864,7 +864,7 @@
864 864
 			}
865 865
 
866 866
 			function clearHtmlIfTextIsEmpty(editorId) {
867
-				var $editor = $(`#${editorId}`);
867
+				var $editor = $('#' + editorId);
868 868
 
869 869
 				$editor.on('input', function() {
870 870
 					if (!(this.textContent || this.querySelectorAll('img, li').length)) {
@@ -983,7 +983,7 @@
983 983
 			}
984 984
 
985 985
 			function setPlaceholder(editorId, placeholder) {
986
-				var editor = $(`#${editorId}`);
986
+				var editor = $('#' + editorId);
987 987
 
988 988
 				//set placeHolder
989 989
 				editor.attr("placeholder",placeholder);
@@ -1347,7 +1347,7 @@
1347 1347
 			}
1348 1348
 
1349 1349
 			function setHTML(editorId, html) {
1350
-				var editor = $(`#${editorId}`);
1350
+				var editor = $('#' + editorId);
1351 1351
 				editor.html(html);
1352 1352
 			}
1353 1353
 
@@ -1516,7 +1516,7 @@
1516 1516
 
1517 1517
 				}
1518 1518
 
1519
-				WebViewBridge.send(JSON.stringify({type: 'SELECTION_CHANGE', data: {items}}))
1519
+				WebViewBridge.send(JSON.stringify({type: 'SELECTION_CHANGE', data: {items: items}}))
1520 1520
 			}
1521 1521
 
1522 1522
 			zss_editor.focusContent = function() {
@@ -1531,7 +1531,7 @@
1531 1531
 
1532 1532
 				// the following was taken from http://stackoverflow.com/questions/1125292/how-to-move-cursor-to-end-of-contenteditable-entity/3866442#3866442
1533 1533
 				// and ensures we move the cursor to the end of the editor
1534
-				var editor = $(`#${editorId}`);
1534
+				var editor = $('#' + editorId);
1535 1535
 				var range = document.createRange();
1536 1536
 				range.selectNodeContents(editor.get(0));
1537 1537
 				range.collapse(false);
@@ -1567,7 +1567,7 @@
1567 1567
 			}
1568 1568
 
1569 1569
 			function addFocusEvent(editorId, callbackHandler) {
1570
-				var editor = $(`#${editorId}`);
1570
+				var editor = $('#' + editorId);
1571 1571
 				editor.focus(callbackHandler);
1572 1572
 			}
1573 1573