PHP Classes

File: public/js/tinymce/src/themes/mobile/src/main/js/util/RangePreserver.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/themes/mobile/src/main/js/util/RangePreserver.js   Download  
File: public/js/tinymce/src/themes/mobile/src/main/js/util/RangePreserver.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 913 bytes
 

Contents

Class file image Download
define( 'tinymce.themes.mobile.util.RangePreserver', [ 'ephox.katamari.api.Fun', 'ephox.sand.api.PlatformDetection' ], function (Fun, PlatformDetection) { var platform = PlatformDetection.detect(); /* At the moment, this is only going to be used for Android. The Google keyboard * that comes with Android seems to shift the selection when the editor gets blurred * to the end of the word. This function rectifies that behaviour * * See fiddle: http://fiddle.tinymce.com/xNfaab/3 or http://fiddle.tinymce.com/xNfaab/4 */ var preserve = function (f, editor) { var rng = editor.selection.getRng(); f(); editor.selection.setRng(rng); }; var forAndroid = function (editor, f) { var wrapper = platform.os.isAndroid() ? preserve : Fun.apply; wrapper(f, editor); }; return { forAndroid: forAndroid }; } );