Add experimental top notify service.

stable
Andrey Antukh 2014-06-25 23:06:15 +02:00
parent 8ab03ab530
commit 01af3f66e0
4 changed files with 31 additions and 12 deletions

View File

@ -20,6 +20,8 @@
###
taiga = @.taiga
timeout = @.taiga.timeout
class ConfirmService extends taiga.Service
@.$inject = ["$q"]
@ -71,6 +73,23 @@ class ConfirmService extends taiga.Service
@.el.removeClass("hidden")
return defered.promise
notify: (type, message) ->
# TODO: at this momment the message is ignored
# because the notification message not permits
# custom messages.
selector = ".notification-message-#{type}"
body = angular.element("body")
body.find(".notification-message").addClass("hidden")
body.find(selector).removeClass("hidden")
if @.tsem
cancelTimeout(@.tsem)
@.tsem = timeout 4000, =>
body.find(selector).addClass("hidden")
delete @.sem
module = angular.module("taigaBase")
module.service("$tgConfirm", ["$q", ConfirmService])

View File

@ -9,8 +9,10 @@ html(lang="en", ng-app="taiga")
meta(name="viewport", content="width=device-width, user-scalable=no")
link(rel="stylesheet", href="/styles/main.css")
body(tg-main)
// TODO: move to inner of ng-view
include partials/views/modules/nav
div.master(ng-view="")
include partials/views/components/notification-message
div.master(ng-view)
div.hidden.lightbox.lightbox_confirm-delete
include partials/views/modules/lightbox_confirm-delete
div.hidden.lightbox.lightbox-generic-error

View File

@ -1,15 +1,13 @@
extends layout
extends dummy-layout
block head
title Taiga Project management web application with scrum in mind!
block content
div.wrapper
include views/components/notification-message
div.wrapper(tg-issues, ng-controller="IssuesController as ctrl")
sidebar.menu-secondary.sidebar
header
h1 Filters
include views/modules/search-in
include views/modules/filter-tags
section.main.issues-page

View File

@ -1,11 +1,11 @@
//div.notification-message.notification-message-success
// div.icon.icon-notification-success
// div.text
// h4.warning Everything is ok
// p Our oompa Loompas saved all your changes!
// a.icon.icon-delete(href="", title="Close notification")
div.hidden.notification-message.notification-message-success
div.icon.icon-notification-success
div.text
h4.warning Everything is ok
p Our oompa Loompas saved all your changes!
a.icon.icon-delete(href="", title="Close notification")
div.notification-message.notification-message-error
div.hidden.notification-message.notification-message-error
div.icon.icon-notification-error
div.text
h4.warning Oops, something happened...