Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

I've added a method that checks if HTML5History is supported(for URLs…

… without Hashtags, for example Google+)
  • Loading branch information...
commit b647718e822e00ba51a87d8329a05ad558cb5c2d 1 parent 3d453b2
theunreplicated authored rhysbrettbowen committed

Showing 1 changed file with 13 additions and 2 deletions. Show diff stats Hide diff stats

  1. 15  router.js
15  router.js
@@ -15,13 +15,24 @@ goog.require('goog.History');
15 15
  * @constructor
16 16
  */
17 17
 mvc.Router = function() {
18  
-    this.history_ = new goog.History();
  18
+    this.checkhistorysupport();
19 19
     goog.events.listen(this.history_, goog.history.EventType.NAVIGATE,
20 20
         this.onChange_, false, this);
21 21
     this.history_.setEnabled(true);
22 22
     this.routes_ = [];
23 23
 };
24  
-
  24
+/**
  25
+*checks if HTML5History is supported
  26
+*/
  27
+mvc.prototype.checkhistorysupport=function (){
  28
+    if(goog.history.Html5History.isSupported()){
  29
+    this.history_= new goog.history.Html5History();this.history_.setUseFragment(false);
  30
+}
  31
+else
  32
+{
  33
+    this.history_=new goog.History();
  34
+}
  35
+};
25 36
 /**
26 37
  * pass through the fragment for the URL
27 38
  *

0 notes on commit b647718

Please sign in to comment.
Something went wrong with that request. Please try again.