Fixing saving of title in browser history

before-bootstrap
Candid Dauth 2014-05-14 14:23:23 +01:00
rodzic 12531a346e
commit 3135c5543f
2 zmienionych plików z 17 dodań i 1 usunięć

Wyświetl plik

@ -130,6 +130,22 @@
};
});
facilpadApp.directive("fpTitle", function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
if(!$(element).is("title"))
return;
scope.$watch(attrs.fpTitle, function(v) {
// We have to call history.replaceState() in order for the new title to end up in the browser history
window.history && history.replaceState({ }, v);
document.title = v;
});
}
};
});
facilpadApp.controller("PadCtrl", function($scope, socket, $timeout, $sce, $parse) {
setTimeout(function() { $("#toolbox").menu(); }, 0);

Wyświetl plik

@ -2,7 +2,7 @@
<html ng-controller="PadCtrl">
<head>
<meta charset="utf-8">
<title>{{padData.name}}</title>
<title fp-title="padData.name + ' – FacilPad'">FacilPad</title>
<script src="js/pad.js"></script>
<style type="text/css">
@import "pad.css";