set button css by attrs

This commit is contained in:
Adam Bradley
2015-12-06 20:44:56 -06:00
parent 4025a01fe0
commit 3d3eae1e4f
8 changed files with 273 additions and 87 deletions

View File

@@ -301,7 +301,10 @@ export class Platform {
* @returns {boolean} TODO
*/
testNavigatorPlatform(navigatorPlatformExpression) {
return navigatorPlatformExpression.test(this._bPlt || '');
if (navigatorPlatformExpression && this._bPlt) {
let rgx = new RegExp(navigatorPlatformExpression, 'i');
return rgx.test(this._bPlt);
}
}
/**

View File

@@ -52,7 +52,7 @@ Platform.register({
// however, under-powered devices shouldn't use ripple
// if this a linux device, and is using Android Chrome v36 (Android 5.0)
// or above then use ripple, otherwise do not use a ripple effect
if (p.testNavigatorPlatform('/linux/i')) {
if (p.testNavigatorPlatform(/linux/i)) {
let chromeVersion = p.matchUserAgentVersion(/Chrome\/(\d+).(\d+)?/);
if (chromeVersion) {
// linux android device using modern android chrome browser gets ripple