MCPcopy Index your code
hub / github.com/JLiscom/OpenNote / activateEditMode

Function activateEditMode

openNote/controllers/noteController.js:93–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 * Take us into edit mode
92 */
93 var activateEditMode = function() {
94 $scope.editMode = true;
95
96 if ($scope.note._id)
97 $scope.showDeleteButton = true;
98
99 $rootScope.buttons = [];
100
101 attachWindowUnload();
102
103 //Add new buttons
104 $rootScope.buttons.push(saveButton());
105 $rootScope.buttons.push(clearButton());
106
107 $timeout(function() { //trick to wait for page to rerender with text area
108 $scope.editor = CodeMirror.fromTextArea(document.getElementById("note-editor"), {
109 mode: "markdown",
110 theme: "material",
111 lineNumbers: true,
112 indentUnit: 4
113 });
114 });
115
116 };
117
118 /**
119 * Save a note

Callers 2

editButtonFunction · 0.85
noteController.jsFile · 0.85

Calls 3

attachWindowUnloadFunction · 0.85
saveButtonFunction · 0.85
clearButtonFunction · 0.85

Tested by

no test coverage detected