-
-
Save Camusensei/9344741 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findIndex = (array, callback) -> | |
_i = 0 | |
while _i < array.length | |
return _i if callback(array[_i]) | |
_i++ | |
-1 | |
$scope.saveCurrentHtmlTemplate = () -> | |
$scope.isEdited = true | |
$('#highlighter').empty() | |
currentHtmlTemplatePositionInArray = findIndex $scope.currentEditedHtmlFiles, (element) -> | |
return element.file_name == $scope.currentHtmlTemplate.file_name | |
if currentHtmlTemplatePositionInArray == -1 | |
currentHtmlTemplatePositionInArray = $scope.currentEditedHtmlFiles.length | |
$scope.currentEditedHtmlFiles[currentHtmlTemplatePositionInArray] = $scope.currentHtmlTemplate | |
$scope.saveTemplate([$scope.currentHtmlTemplate]) | |
getControllerScope "BBCtrl", (scope) -> | |
scope.current_page | |
scope.showPage scope.current_page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment