Commit ed83da7d authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Show a nice tooltip message when (un)subscribing.

parent e01aca27
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
Ext.define('Docs.view.comments.Form', {
    extend: 'Ext.Component',
    alias: "widget.commentsForm",
    requires: ["Docs.Tip"],

    /**
     * @cfg {Object} user
@@ -209,6 +210,19 @@ Ext.define('Docs.view.comments.Form', {
            guideText.hide(true);
            helpLink.update("Show help ↓");
        }
    },

    /**
     * Shows a notification near the checkbox to notify user about the
     * changes subscription status.
     * @param {Boolean} subscribed
     */
    showSubscriptionMessage: function(subscribed) {
        var el = this.getEl().down("input.subscriptionCheckbox");
        var msg = subscribed ?
            "Updates to this thread will be e-mailed to you" :
            "You have unsubscribed from this thread";
        Docs.Tip.show(msg, el, 'bottom');
    }

});
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ Ext.define('Docs.view.comments.ListWithForm', {

    subscribe: function(subscribed) {
        Docs.Comments.subscribe(this.target, subscribed, function() {
            alert("Subscription changed!");
            this.commentingForm.showSubscriptionMessage(subscribed);
        }, this);
    }