Browse Source

修改图片

dgf 8 years ago
parent
commit
d0ace36d7e
1 changed files with 45 additions and 1 deletions
  1. 45 1
      talkview/src/js/directive/image.js

+ 45 - 1
talkview/src/js/directive/image.js

@@ -57,4 +57,48 @@
 //             };
 //         }
 //     }
-// })();
+// })();
+
+/*
+ * A collection of directives that allows creation of custom event handlers that are defined as
+ * angular expressions and are compiled and executed within the current scope.
+ */
+// var ngEventDirectives = {};
+
+// For events that might fire synchronously during DOM manipulation
+// we need to execute their event handlers asynchronously using $evalAsync,
+// so that they are not executed in an inconsistent state.
+// var forceAsyncEvents = {
+//   'blur': true,
+//   'focus': true
+// };
+// forEach(
+//   'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
+//   function(eventName) {
+//     var directiveName = directiveNormalize('ng-' + eventName);
+//     ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
+//       return {
+//         restrict: 'A',
+//         compile: function($element, attr) {
+//           // NOTE:
+//           // We expose the powerful `$event` object on the scope that provides access to the Window,
+//           // etc. This is OK, because expressions are not sandboxed any more (and the expression
+//           // sandbox was never meant to be a security feature anyway).
+//           var fn = $parse(attr[directiveName]);
+//           return function ngEventHandler(scope, element) {
+//             element.on(eventName, function(event) {
+//               var callback = function() {
+//                 fn(scope, {$event: event});
+//               };
+//               if (forceAsyncEvents[eventName] && $rootScope.$$phase) {
+//                 scope.$evalAsync(callback);
+//               } else {
+//                 scope.$apply(callback);
+//               }
+//             });
+//           };
+//         }
+//       };
+//     }];
+//   }
+// );