PHP Classes

File: public/js/tinymce/src/plugins/directionality/src/main/js/core/Direction.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/directionality/src/main/js/core/Direction.js   Download  
File: public/js/tinymce/src/plugins/directionality/src/main/js/core/Direction.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: 946 bytes
 

Contents

Class file image Download
/** * Direction.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ define( 'tinymce.plugins.directionality.core.Direction', [ 'tinymce.core.util.Tools' ], function (Tools) { var setDir = function (editor, dir) { var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks(); if (blocks.length) { curDir = dom.getAttrib(blocks[0], 'dir'); Tools.each(blocks, function (block) { // Add dir to block if the parent block doesn't already have that dir if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); } }); editor.nodeChanged(); } }; return { setDir: setDir }; } );