kopia lustrzana https://github.com/FacilMap/facilmap
Fixing saving of title in browser history
rodzic
12531a346e
commit
3135c5543f
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
|
|
Ładowanie…
Reference in New Issue