]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/js/theme.js
Merge pull request #9039 from MrPetovan/task/frio-accent-scheme
[friendica.git] / view / theme / frio / js / theme.js
index 3a3f02c5e5f239ac379592bbff86be1de5953d5e..b7f222c0a25e6d3c21a077f022b0ee44e002d038 100644 (file)
@@ -362,6 +362,7 @@ $(document).ready(function(){
 
        // Comment form submit
        $body.on('submit', '.comment-edit-form', function(e) {
+               let $form = $(this);
                let id = $form.data('item-id');
 
                // Compose page form exception: id is always 0 and form must not be submitted asynchronously
@@ -371,8 +372,6 @@ $(document).ready(function(){
 
                e.preventDefault();
 
-               let $form = $(this);
-
                let $commentSubmit = $form.find('.comment-edit-submit').button('loading');
 
                unpause();
@@ -703,7 +702,7 @@ function scrollToItem(elementId) {
                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);
        });
 }
 
@@ -721,22 +720,17 @@ function htmlToText(htmlString) {
  * 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