You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/12/17 20:22:17 UTC

[30/50] [abbrv] allura git commit: [#7919] add tooltip for grouping threshold; refactor tooltip some

[#7919] add tooltip for grouping threshold; refactor tooltip some


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

Branch: refs/heads/db/8034
Commit: 68b44f0a4c0b707824c166607c30814029825343
Parents: c23844f
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Dec 8 14:49:36 2015 -0500
Committer: Heith Seewald <he...@gmail.com>
Committed: Wed Dec 16 13:55:38 2015 -0600

----------------------------------------------------------------------
 Allura/allura/public/nf/js/context-menu.es6.js |  9 ++++----
 Allura/allura/public/nf/js/navbar.es6.js       |  7 +++---
 Allura/allura/public/nf/js/tooltip.es6.js      | 25 +++++----------------
 3 files changed, 13 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/68b44f0a/Allura/allura/public/nf/js/context-menu.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/context-menu.es6.js b/Allura/allura/public/nf/js/context-menu.es6.js
index 2cd79a6..3ce3c96 100644
--- a/Allura/allura/public/nf/js/context-menu.es6.js
+++ b/Allura/allura/public/nf/js/context-menu.es6.js
@@ -64,14 +64,13 @@ class ContextMenu extends React.Component {
         let _this = this;
         return (
             <div className="contextMenu">
+                <ToolTip targetSelector='#top_nav_admin .contextMenu a'/>
                 <ul>{
                     this.props.items.map(function (o, i) {
                         return (<li key={i}>
-                            <ToolTipLink
-                                href={o.href}
-                                classes={_this.props.classes.concat([o.className])}
-                                toolTip={o.tooltip}
-                                text={o.text}/>
+                            <a href={o.href}
+                               classes={_this.props.classes.concat([o.className])}
+                               title={o.tooltip}>{o.text}</a>
                         </li>)
                     })}
                 </ul>

http://git-wip-us.apache.org/repos/asf/allura/blob/68b44f0a/Allura/allura/public/nf/js/navbar.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/navbar.es6.js b/Allura/allura/public/nf/js/navbar.es6.js
index 9f805fe..0f35a0c 100644
--- a/Allura/allura/public/nf/js/navbar.es6.js
+++ b/Allura/allura/public/nf/js/navbar.es6.js
@@ -187,11 +187,12 @@ var GroupingThreshold = React.createClass({
                 <div id='threshold-config'>
             <span>
               <label htmlFor='threshold-input'>Grouping Threshold</label>
-                <input type='number' name='threshold-input' className='tooltip'
-                       title='Number of tools allowed before grouping.'
+                <ToolTip targetSelector="#threshold-input" position="top" contentAsHTML={true}/>
+                <input type='number' name='threshold-input' id="threshold-input"
+                       title='When you have multiple tools of the same type, <u>this number</u> determines if they will fit in the navigation bar or be grouped into a dropdown.'
                        value={ this.state.value }
                        onChange={ this.handleChange }
-                       min='1' max='10'/>
+                       min='1' max='50'/>
               </span>
                 </div> }
             </div>

http://git-wip-us.apache.org/repos/asf/allura/blob/68b44f0a/Allura/allura/public/nf/js/tooltip.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/tooltip.es6.js b/Allura/allura/public/nf/js/tooltip.es6.js
index 92ebb3c..fea6471 100644
--- a/Allura/allura/public/nf/js/tooltip.es6.js
+++ b/Allura/allura/public/nf/js/tooltip.es6.js
@@ -29,6 +29,7 @@ class ToolTip extends React.Component {
     }
 
     static propTypes = {
+        targetSelector: React.PropTypes.string.isRequired,
         animation: React.PropTypes.string,
         speed: React.PropTypes.number,
         position: React.PropTypes.string,
@@ -38,10 +39,6 @@ class ToolTip extends React.Component {
         maxWidth: React.PropTypes.number,
         trigger: React.PropTypes.string,
         multiple: React.PropTypes.bool,
-        classes: React.PropTypes.array,
-        text: React.PropTypes.string.isRequired,
-        href: React.PropTypes.string.isRequired,
-        toolTip: React.PropTypes.string
     };
 
     static defaultProps = {
@@ -60,7 +57,7 @@ class ToolTip extends React.Component {
 
     componentDidMount() {
         var _this = this;
-        $(".react-tooltip").tooltipster({
+        $(this.props.targetSelector).tooltipster({
             animation: _this.props.animation,
             speed: _this.props.speed,
             delay: _this.props.delay,
@@ -74,20 +71,8 @@ class ToolTip extends React.Component {
         })
     }
 
-}
-
-/**
- * Tooltip Link
-
- * @constructor
- */
-class ToolTipLink extends ToolTip {
-    constructor(props) {
-        super(props);
-    }
-
     render() {
-        var classes = this.props.classes.join(' ') + " react-tooltip";
-        return <a href={this.props.href} className={classes} title={this.props.toolTip}>{this.props.text}</a>
+        return null;
     }
-}
\ No newline at end of file
+}
+