PHP Classes

File: public/js/tinymce/src/plugins/imagetools/src/main/js/core/UndoStack.js

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

Contents

Class file image Download
/** * UndoStack.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.imagetools.core.UndoStack', [ ], function () { return function () { var data = [], index = -1; function add(state) { var removed; removed = data.splice(++index); data.push(state); return { state: state, removed: removed }; } function undo() { if (canUndo()) { return data[--index]; } } function redo() { if (canRedo()) { return data[++index]; } } function canUndo() { return index > 0; } function canRedo() { return index !== -1 && index < data.length - 1; } return { data: data, add: add, undo: undo, redo: redo, canUndo: canUndo, canRedo: canRedo }; }; } );