landers.angular
Version:
landers.angular
50 lines (47 loc) • 1.4 kB
JavaScript
;angular.module('Landers.angular', [
'cgNotify',
'ngclipboard',
])
.run(['$rootScope', function ($rootScope){
$rootScope.$GEvent = {
// 剪切板
clipboard: {
showTooltip: function(e, title){
var $trigger = angular.isString(e) ?
$(e) : $(e.trigger);
$trigger.tooltip({
title: title,
})
.tooltip('show')
.mouseout(function(){
$(this).tooltip('destroy');
});
angular.isString(e) && setTimeout(function(){
$trigger.trigger('mouseout');
}, 1000);
},
success: function (e, msg) {
this.showTooltip(e, '复制成功');
},
error: function (e) {
this.showTooltip(e, '复制失败');
}
}
}
}]);
function angular_scope_apply(scope, marker) {
var bool1 = '$$phase' in scope;
var bool2 = !scope.$$phase;
var bool3 = !scope.$$preventApply
if (
bool1 && bool2 && bool3
) {
try {
console.log('angular_scope_apply', marker);
scope.$apply();
} catch(e) {
}
} else {
// console.log(scope.$id, bool1, bool2, scope.$$phase, bool3, scope);
}
};