Permalink
Browse files

Enable/disable the browser back and forward buttons as appropriate

  • Loading branch information...
1 parent 6648e09 commit 7cf72d7b3d59c54e143fb34a40b8aadaa243004e @mihaip mihaip committed Oct 18, 2012
Showing with 6 additions and 1 deletion.
  1. +2 −1 browser-tag/browser.css
  2. +4 −0 browser-tag/browser.js
View
@@ -18,7 +18,8 @@ body {
}
button,
-input[type="submit"] {
+input[type="submit"],
+button[disabled]:hover {
border: solid 1px transparent;
background: transparent;
}
View
@@ -67,6 +67,10 @@ function handleNavigation(event) {
}
document.querySelector('#location').value = event.url;
+
+ var browser = document.querySelector('browser');
+ document.querySelector('#back').disabled = !browser.canGoBack();
+ document.querySelector('#forward').disabled = !browser.canGoForward();
}
function handleLoadStart(event) {

0 comments on commit 7cf72d7

Please sign in to comment.