}
});
- //$('ul.flex-nav').flexMenu();
-
// initialize the bootstrap tooltips
- $('body').tooltip({
+ $body.tooltip({
selector: '[data-toggle="tooltip"]',
container: 'body',
animation: true,
// Comment form submit
$body.on('submit', '.comment-edit-form', function(e) {
- e.preventDefault();
-
let $form = $(this);
let id = $form.data('item-id');
+
+ // Compose page form exception: id is always 0 and form must not be submitted asynchronously
+ if (id === 0) {
+ return;
+ }
+
+ e.preventDefault();
+
let $commentSubmit = $form.find('.comment-edit-submit').button('loading');
unpause();
scrollTop: itemPos
}, 400).promise().done( function() {
// Highlight post/commenent with ID (GUID)
- $el.animate(colWhite, 1000).animate(colShiny).animate(colWhite, 600);
+ $el.animate(colWhite, 1000).animate(colShiny).animate({backgroundColor: 'transparent'}, 600);
});
}
* Sends a /like API call and updates the display of the relevant action button
* before the update reloads the item.
*
- * @param {string} ident The id of the relevant item
- * @param {string} verb The verb of the action
- * @returns {undefined}
+ * @param {int} ident The id of the relevant item
+ * @param {string} verb The verb of the action
+ * @param {boolean} un Whether to perform an activity removal instead of creation
*/
-function doLikeAction(ident, verb) {
- unpause();
-
+function doLikeAction(ident, verb, un) {
if (verb.indexOf('attend') === 0) {
$('.item-' + ident + ' .button-event:not(#' + verb + '-' + ident + ')').removeClass('active');
}
$('#' + verb + '-' + ident).toggleClass('active');
- $('#like-rotator-' + ident.toString()).show();
- $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
- liking = 1;
- force_update = true;
- update_item = ident.toString();
+
+ dolike(ident, verb, un);
}
// Decodes a hexadecimally encoded binary string