Improve displa/hide management with hidden css class.

stable
Andrey Antukh 2014-06-17 23:05:30 +02:00
parent b19022acf7
commit 54207eca54
6 changed files with 21 additions and 10 deletions

View File

@ -57,6 +57,8 @@ class BacklogController extends taiga.TaigaController
return promise
## Template actions
deleteUserStory: (us) ->
title = "Delete User Story"
subtitle = us.subject
@ -64,6 +66,11 @@ class BacklogController extends taiga.TaigaController
@confirm.ask(title, subtitle).then =>
console.log "#TODO"
addNewUs: (type) ->
switch type
when "standard" then @rootscope.$emit("usform:new")
when "bulk" then @rootscope.$emit("usform:bulk")
BacklogDirective = ($compile, $templateCache) ->
link = ($scope, $el, $attrs) ->

View File

@ -29,7 +29,7 @@ class ConfirmService extends taiga.TaigaService
_.bindAll(@)
hide: ->
@.el.css("display", "none")
@.el.addClass("hidden")
@.el.off(".confirm-dialog")
ask: (title, subtitle) ->
@ -49,7 +49,7 @@ class ConfirmService extends taiga.TaigaService
defered.reject()
@.hide()
@.el.css("display", "flex")
@.el.removeClass("hidden")
return defered.promise

View File

@ -11,7 +11,7 @@ html(lang="en", ng-app="taiga")
body
include partials/views/modules/nav
div.master(ng-view="")
div.lightbox.lightbox_confirm-delete
div.hidden.lightbox.lightbox_confirm-delete
include partials/views/modules/lightbox_confirm-delete
script(src="/js/libs.js?v=#{v}")
script(src="/js/app.js?v=#{v}")

View File

@ -25,9 +25,9 @@ block content
include views/modules/backlog-table
sidebar.menu-secondary.sidebar
include views/modules/sprints
div.lightbox.lightbox_add-new-us
div.lightbox.lightbox_add-new-us.hidden(tg-lightbox-create-edit-userstory)
include views/modules/lightbox_add-new-us
div.lightbox.lightbox_add-bulk
div.lightbox.lightbox_add-bulk.hidden
include views/modules/lightbox_add-bulk
div.lightbox.lightbox_add-sprint
div.lightbox.lightbox_add-sprint.hidden
include views/modules/lightbox_add-sprint

View File

@ -1,5 +1,5 @@
div.new-us
a.button-green(href="", title="Add New US")
span.text + Add new US
a.button-bulk(href="", title="Bulk")
span.icon.icon-bulk
a.button-green(href="", ng-click="ctrl.addNewUs('standard')", title="Add New US")
span.text + Add new US
a.button-bulk(href="", ng-click="ctrl.addNewUs('bulk')", title="Bulk")
span.icon.icon-bulk

View File

@ -56,3 +56,7 @@ body {
.icon {
font-family: 'taiga';
}
.hidden {
display: none;
}