SRS 6.0-b0 源码 + danmaku 后端(排除 objs/3rdparty/测试媒体)
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
angular.module('bravoUiAlert', [])
|
||||
.directive('bravoAlert', function () {
|
||||
return {
|
||||
restrict: "A",
|
||||
transclude: true,
|
||||
template: '<div ng-transclude></div>',
|
||||
scope: {
|
||||
alert_show: '=alertShow',
|
||||
on_close: '&bravoAlertClose',
|
||||
on_closed: '&bravoAlertClosed'
|
||||
},
|
||||
compile: function (elem, attr) {
|
||||
var manual = attr['alertShow'];
|
||||
return function (scope, elem, attr) {
|
||||
elem.on('click', function(event) {
|
||||
var obj = angular.element(event.target);
|
||||
if (obj.attr('data-dismiss')) {
|
||||
scope.on_destory();
|
||||
}
|
||||
});
|
||||
scope.on_destory = function () {
|
||||
if (!manual) {
|
||||
scope.on_close();
|
||||
elem.addClass('ng-hide');
|
||||
scope.on_closed();
|
||||
} else {
|
||||
scope.on_close();
|
||||
scope.alert_show = false;
|
||||
scope.$apply();
|
||||
}
|
||||
};
|
||||
scope.$watch('alert_show', function (nv, ov) {
|
||||
if (nv != ov) {
|
||||
if (!nv) {
|
||||
elem.addClass('ng-hide');
|
||||
scope.on_closed();
|
||||
} else {
|
||||
elem.removeClass('ng-hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user