Removing edit | preview bar from popups

stable
Alejandro Alonso 2014-07-04 13:41:18 +02:00
parent 1642917788
commit 49a1489f31
5 changed files with 0 additions and 69 deletions

View File

@ -23,25 +23,6 @@ taiga = @.taiga
bindOnce = @.taiga.bindOnce
CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope) ->
editDescription = ($scope, $el) ->
$el.find('.markdown-preview a').removeClass("active")
$el.find('.markdown-preview a.edit').addClass("active")
descriptionDOM = $el.find("textarea.description")
descriptionPreviewDOM = $el.find(".description-preview")
descriptionDOM.show()
descriptionPreviewDOM.hide()
previewDescription = ($scope, $el) ->
$el.find('.markdown-preview a').removeClass("active")
$el.find('.markdown-preview a.preview').addClass("active")
descriptionDOM = $el.find("textarea.description")
descriptionPreviewDOM = $el.find(".description-preview")
$rs.mdrender.render($scope.projectId, $scope.us.description).then (data) ->
descriptionDOM.hide()
descriptionPreviewDOM.html(data.data)
descriptionPreviewDOM.show()
link = ($scope, $el, attrs) ->
isNew = true
@ -52,7 +33,6 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope) ->
status: $scope.project.default_us_status
}
isNew = true
editDescription($scope, $el)
# Update texts for creation
$el.find(".button-green span").html("Create") #TODO: i18n
$el.find(".title").html("New user story ") #TODO: i18n
@ -61,7 +41,6 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope) ->
$scope.$on "usform:edit", (ctx, us) ->
$scope.us = us
isNew = false
editDescription($scope, $el)
# Update texts for edition
$el.find(".button-green span").html("Save") #TODO: i18n
$el.find(".title").html("Edit user story ") #TODO: i18n
@ -81,14 +60,6 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope) ->
# Dom Event Handlers
$el.on "click", ".markdown-preview a.edit", (event) ->
event.preventDefault()
editDescription($scope, $el)
$el.on "click", ".markdown-preview a.preview", (event) ->
event.preventDefault()
previewDescription($scope, $el)
$el.on "click", ".close", (event) ->
event.preventDefault()
$el.addClass("hidden")

View File

@ -23,24 +23,6 @@ taiga = @.taiga
bindOnce = @.taiga.bindOnce
CreateEditTaskDirective = ($repo, $model, $rs, $rootScope) ->
editDescription = ($scope, $el) ->
$el.find('.markdown-preview a').removeClass("active")
$el.find('.markdown-preview a.edit').addClass("active")
descriptionDOM = $el.find("textarea.description")
descriptionPreviewDOM = $el.find(".description-preview")
descriptionDOM.show()
descriptionPreviewDOM.hide()
previewDescription = ($scope, $el) ->
$el.find('.markdown-preview a').removeClass("active")
$el.find('.markdown-preview a.preview').addClass("active")
descriptionDOM = $el.find("textarea.description")
descriptionPreviewDOM = $el.find(".description-preview")
$rs.mdrender.render($scope.projectId, $scope.task.description).then (data) ->
descriptionDOM.hide()
descriptionPreviewDOM.html(data.data)
descriptionPreviewDOM.show()
link = ($scope, $el, attrs) ->
isNew = true
@ -54,7 +36,6 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootScope) ->
assigned_to: null
}
isNew = true
editDescription($scope, $el)
# Update texts for creation
$el.find(".button-green span").html("Create") #TODO: i18n
$el.find(".title").html("New task ") #TODO: i18n
@ -63,7 +44,6 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootScope) ->
$scope.$on "taskform:edit", (ctx, task) ->
$scope.task = task
isNew = false
editDescription($scope, $el)
# Update texts for edition
$el.find(".button-green span").html("Save") #TODO: i18n
$el.find(".title").html("Edit task ") #TODO: i18n
@ -81,14 +61,6 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootScope) ->
# Dom Event Handlers
$el.on "click", ".markdown-preview a.edit", (event) ->
event.preventDefault()
editDescription($scope, $el)
$el.on "click", ".markdown-preview a.preview", (event) ->
event.preventDefault()
previewDescription($scope, $el)
$el.on "click", ".close", (event) ->
event.preventDefault()
$el.addClass("hidden")

View File

@ -14,11 +14,7 @@ form
fieldset
input(type="text", placeholder="Tags", tg-tags, ng-model="task.tags")
fieldset
div.markdown-preview
a.edit.active(href="", title="Edit") Edit
a.preview(href="", title="Preview") Preview
textarea.description(placeholder="Type a short description", ng-model="task.description")
div.description-preview.hidden
div.new-us-settings
fieldset
label.iocaine

View File

@ -28,11 +28,7 @@ form
fieldset
input(type="text", placeholder="Add tags")
fieldset
div.markdown-preview
a.edit.active(href="", title="Edit") Edit
a.preview(href="", title="Preview") Preview
textarea.description(placeholder="description")
div.description-preview.hidden
include lightbox-attachments
a.button.button-green(href="", title="Save")
span Create

View File

@ -10,11 +10,7 @@ form
fieldset
input(type="text", placeholder="Tags", tg-tags, ng-model="us.tags")
fieldset
div.markdown-preview
a.edit.active(href="", title="Edit") Edit
a.preview(href="", title="Preview") Preview
textarea.description(placeholder="One user story per line", ng-model="us.description")
div.description-preview.hidden
div.new-us-settings
fieldset
label.requirement.team-requirement(for="team-requirement", tg-i18n="us.team-requirement")