Removed the confirmation box for marking items in the user panel as read
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / js / WCF.User.js
index 287b684b70a225fae061dbd259753e02ee242f28..f1dc65d17d76f956b64cec877a0ae8d66a7e87b5 100644 (file)
@@ -284,16 +284,12 @@ if (COMPILER_TARGET_DEFAULT) {
                                
                                if (this._options.enableMarkAsRead) {
                                        var $outstandingItems = this._dropdown.getItemList().children('.interactiveDropdownItemOutstanding');
-                                       if (this._markAllAsReadLink === null && $outstandingItems.length && this._options.markAllAsReadConfirmMessage) {
+                                       if (this._markAllAsReadLink === null && $outstandingItems.length) {
                                                var $button = this._markAllAsReadLink = $('<li class="interactiveDropdownItemMarkAllAsRead"><a href="#" title="' + WCF.Language.get('wcf.user.panel.markAllAsRead') + '" class="jsTooltip"><span class="icon icon24 fa-check" /></a></li>').appendTo(this._dropdown.getLinkList());
                                                $button.click((function (event) {
                                                        this._dropdown.close();
                                                        
-                                                       WCF.System.Confirmation.show(this._options.markAllAsReadConfirmMessage, (function (action) {
-                                                               if (action === 'confirm') {
-                                                                       this._markAllAsRead();
-                                                               }
-                                                       }).bind(this));
+                                                       this._markAllAsRead();
                                                        
                                                        return false;
                                                }).bind(this));
@@ -1061,6 +1057,27 @@ if (COMPILER_TARGET_DEFAULT) {
                 * Saves input values.
                 */
                _save: function () {
+                       // check if there is an editor and if it is in WYSIWYG mode
+                       var scrollToEditor = null;
+                       elBySelAll('.redactor-layer', this._tab[0], function(redactorLayer) {
+                               var data = {
+                                       api: {
+                                               throwError: elInnerError
+                                       },
+                                       valid: true
+                               };
+                               WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'validate_' + elData(redactorLayer, 'element-id'), data);
+                               
+                               if (!data.valid && scrollToEditor === null) {
+                                       scrollToEditor = redactorLayer.parentNode;
+                               }
+                       });
+                       
+                       if (scrollToEditor) {
+                               scrollToEditor.scrollIntoView({ behavior: 'smooth' });
+                               return;
+                       }
+                       
                        this._actionName = 'save';
                        
                        // collect values
@@ -1928,6 +1945,7 @@ WCF.User.RecentActivityLoader = Class.extend({
  * Loads likes once the user scrolls to the very bottom.
  * 
  * @param      integer         userID
+ * @deprecated  since 3.2
  */
 WCF.User.LikeLoader = Class.extend({
        /**