/**
 * Created by Jackey Li on 15/12/8.
 */
(function (angular) {
	'use strict';

	angular.module(globals.appName).directive('platformScrollToTop',
		['platformBrowserTeller',
		 function (platformBrowserTeller) {
			 return {
				 restrict: 'EA',
				 scope: {
					 content: '@'
				 },
				 template: '<div class="scrollToTop">{{::content}}</div>',
				 link: function (scope, element) {

					 element.bind('click', function () {

						 if (platformBrowserTeller && (platformBrowserTeller.mozilla || platformBrowserTeller.msie)) {
							 //firefox IE
							 document.documentElement.scrollTop = 0;
						 }
						 else {
							 //chrome safari
							 document.body.scrollTop = 0;
						 }

					 });

					 scope.$on('$destroy', function () {
						 element.unbind('click');
					 });
				 }
			 };
		 }]);
})(angular);
@@ -59,17 +59,20 @@
 ular) %7B%0A
-%09
+    
 'use str
@@ -78,17 +78,20 @@
 rict';%0A%0A
-%09
+    
 angular.
@@ -147,18 +147,24 @@
 ToTop',%0A
-%09%09
+        
 %5B'platfo
@@ -181,18 +181,27 @@
 eller',%0A
-%09%09
+           
  functio
@@ -232,87 +232,177 @@
 ) %7B%0A
-%09%09%09 return %7B%0A%09%09%09%09 restrict: 'EA',%0A%09%09%09%09 scope: %7B%0A%09%09%09%09%09 content: '@'%0A%09%09%09%09 %7D,%0A%09%09%09%09
+                return %7B%0A                    restrict: 'EA',%0A                    scope: %7B%0A                        content: '@'%0A                    %7D,%0A                   
  tem
@@ -456,20 +456,35 @@
 /div%3E',%0A
-%09%09%09%09
+                   
  link: f
@@ -511,21 +511,39 @@
 ent) %7B%0A%0A
-%09%09%09%09%09
+                       
  element
@@ -572,22 +572,43 @@
 n () %7B%0A%0A
-%09%09%09%09%09%09
+                           
  if (pla
@@ -698,282 +698,551 @@
 ) %7B%0A
-%09%09%09%09%09%09%09 //firefox IE%0A%09%09%09%09%09%09%09 document.documentElement.scrollTop = 0;%0A%09%09%09%09%09%09 %7D%0A%09%09%09%09%09%09 else %7B%0A%09%09%09%09%09%09%09 //chrome safari%0A%09%09%09%09%09%09%09 document.body.scrollTop = 0;%0A%09%09%09%09%09%09 %7D%0A%0A%09%09%09%09%09 %7D);%0A%0A%09%09%09%09%09 scope.$on('$destroy', function () %7B%0A%09%09%09%09%09%09 element.unbind('click');%0A%09%09%09%09%09 %7D);%0A%09%09%09%09 %7D%0A%09%09%09 %7D;%0A%09%09
+                                //firefox IE%0A                                document.documentElement.scrollTop = 0;%0A                            %7D%0A                            else %7B%0A                                //chrome safari%0A                                document.body.scrollTop = 0;%0A                            %7D%0A                        %7D);%0A%0A                        scope.$on('$destroy', function () %7B%0A                            element.unbind('click');%0A                        %7D);%0A                    %7D%0A                %7D;%0A           
  %7D%5D)

format code