allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#8233] Add notify message instead tooltip
Date Thu, 27 Sep 2018 18:43:32 GMT
Repository: allura
Updated Branches:
  refs/heads/master 61189717d -> bfad59190


[#8233] Add notify message instead tooltip


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/bfad5919
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/bfad5919
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/bfad5919

Branch: refs/heads/master
Commit: bfad591909d0b9e7953a4b5b803a33bd919e7ae5
Parents: 6118971
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Wed Sep 19 21:51:31 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Sep 27 18:42:29 2018 +0000

----------------------------------------------------------------------
 .../allura/lib/widgets/resources/js/subscriptions.js | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/bfad5919/Allura/allura/lib/widgets/resources/js/subscriptions.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/subscriptions.js b/Allura/allura/lib/widgets/resources/js/subscriptions.js
index 986f05e..8b4bfeb 100644
--- a/Allura/allura/lib/widgets/resources/js/subscriptions.js
+++ b/Allura/allura/lib/widgets/resources/js/subscriptions.js
@@ -65,24 +65,21 @@ SubscriptionForm = React.createClass({
         set_state({
           subscribed: resp.subscribed,
         });
-        var link = this.getLinkNode();
         var text = null;
+        var msgStat = null;
         if (resp.subscribed_to_tool) {
+          msgStat = 'error';
           text = "You can't subscribe to this ";
           text += this.props.thing;
           text += " because you are already subscribed to the entire ";
           text += resp.subscribed_to_entire_name ? resp.subscribed_to_entire_name : "tool";
           text += ".";
         } else {
+          msgStat = 'info';
           var action = resp.subscribed ? 'subscribed to' : 'unsubscribed from';
           text = 'Successfully ' + action + ' this ' + this.props.thing + '.';
         }
-        $(link).tooltipster('content', text).tooltipster('show');
-        if (this.state.tooltip_timeout) {
-          clearTimeout(this.state.tooltip_timeout);
-        }
-        var t = setTimeout(function() { $(link).tooltipster('hide'); }, 4000);
-        this.setState({tooltip_timeout: t});
+        $('#messages').notify(text, {status: msgStat});
       }
     }.bind(this)).always(function() {
       set_state({in_progress: false});
@@ -95,10 +92,10 @@ SubscriptionForm = React.createClass({
   componentDidMount: function() {
     var link = this.getLinkNode();
     $(link).tooltipster({
-      content: '',
+      content: null,
       animation: 'fade',
       delay: 200,
-      trigger: 'custom',
+      trigger: 'hover',
       position: 'top',
       iconCloning: false,
       maxWidth: 300


Mime
View raw message