code: function isTablet (mockUserAgent) {
    var userAgent = mockUserAgent || window.navigator.userAgent;
    return /ipad|Nexus (7|9)|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent);
  }
docs: Detect tablet devices.
  @param {string} mockUserAgent - Allow passing a mock user agent for testing.