diff --git a/client/components/search/index.jsx b/client/components/search/index.jsx
index a17db3567f129..fa8c5e081eef9 100644
--- a/client/components/search/index.jsx
+++ b/client/components/search/index.jsx
@@ -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
*/
@@ -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 ||
@@ -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' } ) }>
+ aria-controls={ 'search-component-' + this.state.instanceId }
+ aria-label={ i18n.translate( 'Close Search', { context: 'button label' } ) }>
);
diff --git a/client/components/section-nav/tabs.jsx b/client/components/section-nav/tabs.jsx
index aea365eb29bc8..5f52347063cd8 100644
--- a/client/components/section-nav/tabs.jsx
+++ b/client/components/section-nav/tabs.jsx
@@ -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 (
@@ -87,8 +89,8 @@ var NavTabs = React.createClass( {
{
- this.state.isDropdown && typeof( window ) === 'object' &&
- window.innerWidth > MOBILE_PANEL_THRESHOLD &&
+ this.state.isDropdown &&
+ innerWidth > MOBILE_PANEL_THRESHOLD &&
this.getDropdown()
}
diff --git a/client/components/spinner/index.jsx b/client/components/spinner/index.jsx
index 7f69277f7f052..1619a4539c0f6 100644
--- a/client/components/spinner/index.jsx
+++ b/client/components/spinner/index.jsx
@@ -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() {