code: function () {
            // Has undo levels or typing and content isn't the same as the initial level
            return index > 0 || (self.typing && data[0] && !Levels.isEq(Levels.createFromEditor(editor), data[0]));
          }
docs: Returns true/false if the undo manager has any undo levels.
  
  @method hasUndo
  @return {Boolean} true/false if the undo manager has any undo levels.