2015-05-01 09:48:52 -04:00
|
|
|
/*
|
|
|
|
* Apllication Controller
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-05-03 22:09:25 -04:00
|
|
|
angularIO.controller('AppCtrl', ['$scope', '$mdDialog', '$timeout', function($scope, $mdDialog, $timeout) {
|
2015-05-01 09:48:52 -04:00
|
|
|
$scope.showDocsNav = false;
|
|
|
|
$scope.showMainNav = false;
|
|
|
|
$scope.showMenu = false;
|
|
|
|
|
|
|
|
// TOGGLE MAIN NAV (TOP) ON MOBILE
|
|
|
|
$scope.toggleDocsMenu = function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
$scope.showDocsNav = !$scope.showDocsNav;
|
|
|
|
};
|
|
|
|
|
|
|
|
// TOGGLE DOCS NAV
|
|
|
|
$scope.toggleMainMenu = function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
$scope.showMainNav = !$scope.showMainNav;
|
|
|
|
};
|
|
|
|
|
|
|
|
// TOGGLE DOCS VERSION & LANGUAGE
|
|
|
|
$scope.toggleVersionMenu = function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
$scope.showMenu = !$scope.showMenu;
|
|
|
|
};
|
|
|
|
|
2015-05-03 22:10:10 -04:00
|
|
|
|
2015-05-03 22:09:25 -04:00
|
|
|
/*
|
|
|
|
* Prettify Code
|
|
|
|
*
|
|
|
|
* Finish Rendereding code directives then prettify code
|
|
|
|
*/
|
|
|
|
|
2015-05-03 23:28:21 -04:00
|
|
|
// GRAB ALL TAGS NOT USING DIRECTIVES
|
|
|
|
var preTags = angular.element(document.body).find('pre');
|
|
|
|
|
|
|
|
// LOOP THROUGH AND ADD PRETTIFY CLASS
|
|
|
|
_.each(preTags, function(element) {
|
|
|
|
var preTag = angular.element(element);
|
|
|
|
|
|
|
|
// IF NOT FORMATTED, ADD PRETTY PRINT
|
|
|
|
if(!preTag.hasClass('prettyprint')) {
|
|
|
|
preTag.addClass('prettyprint linums');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// TRIGGER PRETTYPRINT AFTER DIGEST LOOP COMPLETE
|
2015-05-03 22:09:25 -04:00
|
|
|
$timeout(prettyPrint, 1);
|
2015-05-01 09:48:52 -04:00
|
|
|
}]);
|