mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 02:42:47 +00:00
[top notice] enable close 'cur note'
This commit is contained in:
@@ -29,7 +29,7 @@
|
|||||||
{% if request.user.is_authenticated and request.cur_note %}
|
{% if request.user.is_authenticated and request.cur_note %}
|
||||||
<div id="info-bar">
|
<div id="info-bar">
|
||||||
<p id="info-bar-info">{{ request.cur_note.message|urlize|url_target_blank }}</p>
|
<p id="info-bar-info">{{ request.cur_note.message|urlize|url_target_blank }}</p>
|
||||||
<img src="{{ MEDIA_URL }}img/del.png" class="close" data="{{ request.cur_note.id }}" />
|
<img src="{{ MEDIA_URL }}img/del.png" class="close" alt="" />
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock info_bar_message %}
|
{% endblock info_bar_message %}
|
||||||
|
@@ -285,7 +285,8 @@ app["pageOptions"] = {
|
|||||||
guide_enabled: {% if guide_enabled %} true {% else %} false {% endif %},
|
guide_enabled: {% if guide_enabled %} true {% else %} false {% endif %},
|
||||||
enable_upload_folder: {% if enable_upload_folder %} true {% else %} false {% endif %},
|
enable_upload_folder: {% if enable_upload_folder %} true {% else %} false {% endif %},
|
||||||
max_upload_file_size: {% if max_upload_file_size %} {{ max_upload_file_size }} {% else %} '' {% endif %},
|
max_upload_file_size: {% if max_upload_file_size %} {{ max_upload_file_size }} {% else %} '' {% endif %},
|
||||||
folder_perm_enabled: {% if folder_perm_enabled %} true {% else %} false {% endif %}
|
folder_perm_enabled: {% if folder_perm_enabled %} true {% else %} false {% endif %},
|
||||||
|
cur_note: {% if request.cur_note %} {'id': '{{ request.cur_note.id }}'} {% else %} null {% endif %}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
{% if debug %}
|
{% if debug %}
|
||||||
|
@@ -48,6 +48,8 @@ define([
|
|||||||
if (app.pageOptions.top_nav_groups.length > 0) {
|
if (app.pageOptions.top_nav_groups.length > 0) {
|
||||||
this.topGroupNavView = new GroupNavView();
|
this.topGroupNavView = new GroupNavView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#info-bar .close').click(Common.closeTopNoticeBar);
|
||||||
},
|
},
|
||||||
|
|
||||||
switchCurrentView: function(newView) {
|
switchCurrentView: function(newView) {
|
||||||
|
@@ -477,6 +477,31 @@ define([
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
closeTopNoticeBar: function () {
|
||||||
|
if (!app.pageOptions.cur_note) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var new_info_id = app.pageOptions.cur_note.id;
|
||||||
|
$('#info-bar').addClass('hide');
|
||||||
|
if (navigator.cookieEnabled) {
|
||||||
|
var date = new Date(),
|
||||||
|
cookies = document.cookie.split('; '),
|
||||||
|
info_id_exist = false;
|
||||||
|
date.setTime(date.getTime() + 14*24*60*60*1000);
|
||||||
|
new_info_id += '; expires=' + date.toGMTString() + '; path=' + app.config.siteRoot;
|
||||||
|
for (var i = 0, len = cookies.length; i < len; i++) {
|
||||||
|
if (cookies[i].split('=')[0] == 'info_id') {
|
||||||
|
info_id_exist = true;
|
||||||
|
document.cookie = 'info_id=' + cookies[i].split('=')[1] + new_info_id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!info_id_exist) {
|
||||||
|
document.cookie = 'info_id=' + new_info_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
contactInputOptionsForSelect2: function() {
|
contactInputOptionsForSelect2: function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user