allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [26/50] [abbrv] allura git commit: [#7919] add tooltip for grouping threshold; refactor tooltip some
Date Fri, 08 Jan 2016 19:30:31 GMT
[#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/10b82c27
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/10b82c27
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/10b82c27

Branch: refs/heads/master
Commit: 10b82c27b7cb52e0c66b8472ff07e9f3b85b1fb1
Parents: 6030a3c
Author: Dave Brondsema <dave@brondsema.net>
Authored: Tue Dec 8 14:49:36 2015 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jan 8 14:06:16 2016 -0500

----------------------------------------------------------------------
 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/10b82c27/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/10b82c27/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/10b82c27/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
+}
+


Mime
View raw message