Skip to content

Commit

Permalink
few more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehg committed Feb 19, 2016
1 parent 6693dfc commit c9bd8ee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions client/components/search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import analytics from 'analytics';
import Spinner from 'components/spinner';
import Gridicon from 'components/gridicon';
import { isMobile } from 'lib/viewport';
import i18n from 'lib/mixins/i18n';

/**
* Internal variables
*/
Expand Down Expand Up @@ -230,7 +232,7 @@ const Search = React.createClass( {
var searchClass,
searchValue = this.state.keyword,
placeholder = this.props.placeholder ||
this.translate( 'Search…', { textOnly: true } ),
i18n.translate( 'Search…', { textOnly: true } ),

enableOpenIcon = this.props.pinned && ! this.state.isOpen,
isOpenUnpinnedOrQueried = this.state.isOpen ||
Expand Down Expand Up @@ -263,7 +265,7 @@ const Search = React.createClass( {
: null
}
aria-controls={ 'search-component-' + this.state.instanceId }
aria-label={ this.translate( 'Open Search', { context: 'button label' } ) }>
aria-label={ i18n.translate( 'Open Search', { context: 'button label' } ) }>
<Gridicon icon="search" className="search-open__icon"/>
</div>
<input
Expand Down Expand Up @@ -294,8 +296,8 @@ const Search = React.createClass( {
onTouchTap={ this.closeSearch }
tabIndex="0"
onKeyDown={ this._keyListener.bind( this, 'closeSearch' ) }
aria-controls={ 'search-component-' + this.id }
aria-label={ this.translate( 'Close Search', { context: 'button label' } ) }>
aria-controls={ 'search-component-' + this.state.instanceId }
aria-label={ i18n.translate( 'Close Search', { context: 'button label' } ) }>
<Gridicon icon="cross" className="search-close__icon"/>
</span>
);
Expand Down
6 changes: 4 additions & 2 deletions client/components/section-nav/tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ var NavTabs = React.createClass( {
'has-siblings': this.props.hasSiblingControls
} );

var innerWidth = global.window ? global.window.innerWidth : 769; //FIXME: should estimate this magic value on the server

return (
<div className="section-nav-group" ref="navGroup">
<div className={ tabsClassName }>
Expand All @@ -87,8 +89,8 @@ var NavTabs = React.createClass( {
</ul>

{
this.state.isDropdown && typeof( window ) === 'object' &&
window.innerWidth > MOBILE_PANEL_THRESHOLD &&
this.state.isDropdown &&
innerWidth > MOBILE_PANEL_THRESHOLD &&
this.getDropdown()
}
</div>
Expand Down
3 changes: 2 additions & 1 deletion client/components/spinner/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Spinner = React.createClass( {
* elements, or false otherwise.
*/
isSVGCSSAnimationSupported: function() {
return ! /(MSIE |Trident\/)/.test( global.window.navigator.userAgent );
const navigator = global.window ? global.window.navigator.userAgent : ''; // FIXME: replace with UA from server
return ! /(MSIE |Trident\/)/.test( navigator );
},

getClassName: function() {
Expand Down

0 comments on commit c9bd8ee

Please sign in to comment.