mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 15:40:22 +00:00
- There was a perceived lag when typing do to the fact that we were listening on the keyup event instead of keydown. The issue with keydown is that we can not read the value of the input field. To solve this we schedule a defer call and perform the model update then. - To prevent calling $eval on root scope too many times as well as to prevent drowning the browser with too many updates we now call the $eval only after 25ms and any additional requests get ignored. The new update service is called $updateView
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
DocsController.$inject = ['$location', '$browser', '$window'];
|
|
function DocsController($location, $browser, $window) {
|
|
this.pages = NG_PAGES;
|
|
window.$root = this.$root;
|
|
|
|
this.getUrl = function(page){
|
|
return '#!' + page.name;
|
|
};
|
|
|
|
this.getCurrentPartial = function(){
|
|
return './' + this.getTitle() + '.html';
|
|
};
|
|
|
|
this.getTitle = function(){
|
|
var hashPath = $location.hashPath || '!angular';
|
|
if (hashPath.match(/^!angular/)) {
|
|
this.partialTitle = hashPath.substring(1);
|
|
}
|
|
return this.partialTitle;
|
|
};
|
|
|
|
this.getClass = function(page) {
|
|
var depth = page.name.split(/\./).length - 1,
|
|
cssClass = 'level-' + depth + (page.name == this.getTitle() ? ' selected' : '');
|
|
|
|
if (depth == 1 && page.type !== 'overview') cssClass += ' level-angular';
|
|
|
|
return cssClass;
|
|
};
|
|
|
|
this.afterPartialLoaded = function() {
|
|
SyntaxHighlighter.highlight();
|
|
};
|
|
|
|
this.getFeedbackUrl = function() {
|
|
return "mailto:angular@googlegroups.com?" +
|
|
"subject=" + escape("Feedback on " + $location.href) + "&" +
|
|
"body=" + escape("Hi there,\n\nI read " + $location.href + " and wanted to ask ....");
|
|
};
|
|
|
|
}
|
|
|
|
angular.filter('short', function(name){
|
|
return (name||'').split(/\./).pop();
|
|
});
|
|
|
|
SyntaxHighlighter['defaults'].toolbar = false;
|