mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Respect pinned post when inserting a a new stream entry
This commit is contained in:
parent
13a5cd5368
commit
4f6a3098ce
@ -15,6 +15,7 @@ HumHub Change Log
|
||||
- Enh: Added 'containerLink' HTML Helper method
|
||||
- Enh: WallEntry layout layout improvements
|
||||
- Fix: Default user & space module configuration lost after foreign key migration
|
||||
- Fix: Respect pinned post when inserting a a new stream entry
|
||||
|
||||
|
||||
1.2.0-beta.3 (March 20, 2017)
|
||||
|
@ -41,10 +41,6 @@ humhub.module('content.form', function(module, require, $) {
|
||||
}
|
||||
};
|
||||
|
||||
CreateForm.prototype.actions = function() {
|
||||
return ['submit', 'notifyUser', 'changeVisibility'];
|
||||
};
|
||||
|
||||
CreateForm.prototype.submit = function(evt) {
|
||||
this.$.find("#contentFormError, .preferences, .fileinput-button").hide();
|
||||
this.$.find("#contentFormError li").remove();
|
||||
|
@ -602,7 +602,14 @@ humhub.module('stream', function (module, require, $) {
|
||||
});
|
||||
};
|
||||
|
||||
Stream.prototype.prependEntry = function (html) {
|
||||
Stream.prototype.prependEntry = function (html, respectPinnedPosts) {
|
||||
if(respectPinnedPosts) {
|
||||
var $pinned = this.$.find('[data-stream-pinned="1"]:last');
|
||||
if($pinned.length) {
|
||||
return this.after(html, $pinned);
|
||||
}
|
||||
}
|
||||
|
||||
return this._streamEntryAnimation(html, function ($html) {
|
||||
this.$content.prepend($html);
|
||||
});
|
||||
@ -885,7 +892,8 @@ humhub.module('stream', function (module, require, $) {
|
||||
|
||||
if (!pjax) {
|
||||
event.on('humhub:modules:content:newEntry.stream', function (evt, html) {
|
||||
getStream().prependEntry(html);
|
||||
// Prepend entry under last pinned post
|
||||
getStream().prependEntry(html, true);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user