Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
812ed47b
Valider
812ed47b
rédigé
10 years ago
par
diosmosis
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Refs #6452, move remove existing notification fix to angular directive.
parent
6aa12a40
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
plugins/CoreHome/angularjs/notification/notification.directive.js
+14
-14
14 ajouts, 14 suppressions
...CoreHome/angularjs/notification/notification.directive.js
plugins/CoreHome/javascripts/notification.js
+0
-14
0 ajout, 14 suppressions
plugins/CoreHome/javascripts/notification.js
avec
14 ajouts
et
28 suppressions
plugins/CoreHome/angularjs/notification/notification.directive.js
+
14
−
14
Voir le fichier @
812ed47b
...
@@ -43,7 +43,11 @@
...
@@ -43,7 +43,11 @@
templateUrl
:
'
plugins/CoreHome/angularjs/notification/notification.directive.html?cb=
'
+
piwik
.
cacheBuster
,
templateUrl
:
'
plugins/CoreHome/angularjs/notification/notification.directive.html?cb=
'
+
piwik
.
cacheBuster
,
controller
:
'
NotificationController
'
,
controller
:
'
NotificationController
'
,
controllerAs
:
'
notification
'
,
controllerAs
:
'
notification
'
,
link
:
function
(
scope
,
element
,
attrs
)
{
link
:
function
(
scope
,
element
)
{
if
(
scope
.
notificationId
)
{
closeExistingNotificationHavingSameIdIfNeeded
(
scope
.
notificationId
,
element
);
}
if
(
scope
.
context
)
{
if
(
scope
.
context
)
{
element
.
children
(
'
.notification
'
).
addClass
(
'
notification-
'
+
scope
.
context
);
element
.
children
(
'
.notification
'
).
addClass
(
'
notification-
'
+
scope
.
context
);
}
}
...
@@ -53,10 +57,6 @@
...
@@ -53,10 +57,6 @@
scope
.
noclear
=
false
;
scope
.
noclear
=
false
;
}
}
if
(
scope
.
notificationId
)
{
closeExistingNotificationHavingSameIdIfNeeded
();
}
if
(
'
toast
'
==
scope
.
type
)
{
if
(
'
toast
'
==
scope
.
type
)
{
addToastEvent
();
addToastEvent
();
}
}
...
@@ -65,15 +65,6 @@
...
@@ -65,15 +65,6 @@
addCloseEvent
();
addCloseEvent
();
}
}
function
closeExistingNotificationHavingSameIdIfNeeded
()
{
// TODO: instead of doing a global query for notification, there should be a notification-container
// directive that manages notifications.
var
existingNode
=
angular
.
element
(
'
.system.notification[notification-id=
'
+
attrs
.
id
+
'
]
'
);
if
(
existingNode
&&
existingNode
.
length
)
{
existingNode
.
remove
();
}
}
function
addToastEvent
()
{
function
addToastEvent
()
{
$timeout
(
function
()
{
$timeout
(
function
()
{
element
.
fadeOut
(
'
slow
'
,
function
()
{
element
.
fadeOut
(
'
slow
'
,
function
()
{
...
@@ -89,6 +80,15 @@
...
@@ -89,6 +80,15 @@
}
}
});
});
}
}
function
closeExistingNotificationHavingSameIdIfNeeded
(
id
,
notificationElement
)
{
// TODO: instead of doing a global query for notification, there should be a notification-container
// directive that manages notifications.
var
existingNode
=
angular
.
element
(
'
[notification-id=
'
+
id
+
'
]
'
).
not
(
notificationElement
);
if
(
existingNode
&&
existingNode
.
length
)
{
existingNode
.
remove
();
}
}
}
}
};
};
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
plugins/CoreHome/javascripts/notification.js
+
0
−
14
Voir le fichier @
812ed47b
...
@@ -50,8 +50,6 @@
...
@@ -50,8 +50,6 @@
options
=
{};
options
=
{};
}
}
closeExistingNotificationHavingSameIdIfNeeded
(
options
);
var
template
=
generateNotificationHtmlMarkup
(
options
,
message
);
var
template
=
generateNotificationHtmlMarkup
(
options
,
message
);
this
.
$node
=
placeNotification
(
template
,
options
);
this
.
$node
=
placeNotification
(
template
,
options
);
};
};
...
@@ -111,16 +109,4 @@
...
@@ -111,16 +109,4 @@
return
$notificationNode
;
return
$notificationNode
;
}
}
function
closeExistingNotificationHavingSameIdIfNeeded
(
options
)
{
if
(
!
options
.
id
)
{
return
;
}
var
$existingNode
=
$
(
'
[notification-id=
'
+
options
.
id
+
'
]
'
);
if
(
$existingNode
&&
$existingNode
.
length
)
{
$existingNode
.
remove
();
}
}
})(
jQuery
,
require
);
})(
jQuery
,
require
);
\ No newline at end of file
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter