mirror of https://gitee.com/bigwinds/arangodb
notification prep. + karma fix
This commit is contained in:
parent
cecb40147d
commit
286bcc658a
|
@ -265,3 +265,64 @@ li a [class^="icon_arangodb"], li a [class*=" icon_arangodb"] {
|
||||||
font-size: 23px;
|
font-size: 23px;
|
||||||
color: #736B68;
|
color: #736B68;
|
||||||
}
|
}
|
||||||
|
/*copy to scss*/
|
||||||
|
.fixedDropdown {
|
||||||
|
margin: 34px 0 0 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
width: 210px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown:after {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown .dropdown-item {
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown .dropdown-header {
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown a {
|
||||||
|
padding-left: 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown .notificationItemContent {
|
||||||
|
width: 170px;
|
||||||
|
float: left;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown button {
|
||||||
|
float:right;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.innerDropdownInnerUL {
|
||||||
|
min-height: 220px;
|
||||||
|
height: 220px !important;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
|
float: left;
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.innerDropdownInnerUL li {
|
||||||
|
width: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.innerDropdownInnerUL li:last-child {
|
||||||
|
color: red;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedDropdown .notificationItem {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notificationItem i {
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
|
@ -61,3 +61,6 @@ body, input, textarea, .page-title span, .pingback a.url {
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixedDropdown {
|
||||||
|
margin: 34px 0 0 !important;
|
||||||
|
}
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
this.foxxList = new window.FoxxCollection();
|
this.foxxList = new window.FoxxCollection();
|
||||||
this.notificationList = new window.NotificationCollection();
|
|
||||||
|
|
||||||
this.footerView = new window.FooterView();
|
this.footerView = new window.FooterView();
|
||||||
this.naviView = new window.NavigationView();
|
this.naviView = new window.NavigationView();
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
<% var i; for (i=0; i < notifications.length; i++) { %>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<div class="notificationItem">
|
||||||
|
<a class="notificationItemTitle"><%=notifications[i].attributes.title%></a>
|
||||||
|
<div class="notificationItemContent"><%=notifications[i].attributes.content%></div>
|
||||||
|
<i class="fa fa-times-circle-o"></i>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<% console.log(i); } %>
|
|
@ -1,7 +1,7 @@
|
||||||
<ul class="navlist" id="userBarUl">
|
<ul class="navlist" id="userBarUl">
|
||||||
|
|
||||||
<div class="navlogo">
|
<div class="navlogo">
|
||||||
<a id="stat_hd" class="notificationButton" href="#dashboard">
|
<a id="stat_hd" class="notificationButton">
|
||||||
<img src="img/tmpNotificationCounter.jpg">
|
<img src="img/tmpNotificationCounter.jpg">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,4 +23,19 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="dropdown">
|
||||||
|
<ul class="user-dropdown-menu fixedDropdown" id="notification_menu">
|
||||||
|
<li class="dropdown-header"><a>Notifications</a></li>
|
||||||
|
<ul class="innerDropdownInnerUL">
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<button id="removeAllNotifications" class="btn btn-danger">Clear</button>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
|
@ -426,6 +426,7 @@
|
||||||
deleted = true;
|
deleted = true;
|
||||||
}
|
}
|
||||||
else if (result === false) {
|
else if (result === false) {
|
||||||
|
arangoHelper.arangoError('Doc error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.type === 'edge') {
|
else if (this.type === 'edge') {
|
||||||
|
|
|
@ -9,9 +9,16 @@
|
||||||
"change #userBarSelect": "navigateBySelect",
|
"change #userBarSelect": "navigateBySelect",
|
||||||
"click .tab": "navigateByTab",
|
"click .tab": "navigateByTab",
|
||||||
"mouseenter .dropdown": "showDropdown",
|
"mouseenter .dropdown": "showDropdown",
|
||||||
"mouseleave .dropdown": "hideDropdown"
|
"mouseleave .dropdown": "hideDropdown",
|
||||||
|
"click .navlogo #stat_hd" : "toggleNotification"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
initialize: function () {
|
||||||
|
this.notificationList = new window.NotificationCollection();
|
||||||
|
},
|
||||||
|
|
||||||
|
notificationItem: templateEngine.createTemplate("notificationItem.ejs"),
|
||||||
|
|
||||||
template: templateEngine.createTemplate("userBarView.ejs"),
|
template: templateEngine.createTemplate("userBarView.ejs"),
|
||||||
|
|
||||||
navigateBySelect: function () {
|
navigateBySelect: function () {
|
||||||
|
@ -32,6 +39,10 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleNotification: function (e) {
|
||||||
|
$('#notification_menu').toggle();
|
||||||
|
},
|
||||||
|
|
||||||
showDropdown: function (e) {
|
showDropdown: function (e) {
|
||||||
var tab = e.target || e.srcElement;
|
var tab = e.target || e.srcElement;
|
||||||
var navigateTo = tab.id;
|
var navigateTo = tab.id;
|
||||||
|
@ -54,15 +65,29 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateNotifications: function() {
|
||||||
|
this.renderNotifications();
|
||||||
|
},
|
||||||
|
|
||||||
|
renderNotifications: function() {
|
||||||
|
$('.innerDropdownInnerUL').html(this.notificationItem.render({
|
||||||
|
notifications : this.notificationList.models
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
|
||||||
render: function (el) {
|
render: function (el) {
|
||||||
console.log(el);
|
|
||||||
this.$el = el;
|
this.$el = el;
|
||||||
this.$el.html(this.template.render({
|
this.$el.html(this.template.render({
|
||||||
img : "https://s.gravatar.com/avatar/9c53a795affc3c3c03801ffae90e2e11?s=80",
|
img : "https://s.gravatar.com/avatar/9c53a795affc3c3c03801ffae90e2e11?s=80",
|
||||||
prename : "Floyd",
|
prename : "Floyd",
|
||||||
lastname : "Pepper"
|
lastname : "Pepper",
|
||||||
|
notifications : this.notificationList.models
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
this.renderNotifications();
|
||||||
|
|
||||||
this.delegateEvents();
|
this.delegateEvents();
|
||||||
|
this.updateNotifications();
|
||||||
return this.$el;
|
return this.$el;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue