2019-05-09 06:54:39 +00:00
|
|
|
(function (window) {
|
2019-05-09 08:01:51 +00:00
|
|
|
window.ls.container.get('view').add({
|
2019-05-09 06:54:39 +00:00
|
|
|
selector: 'data-switch',
|
2019-05-22 21:03:37 +00:00
|
|
|
controller: function(element, router, document) {
|
2019-08-21 19:22:48 +00:00
|
|
|
let check = function (c) {
|
2019-08-21 11:00:32 +00:00
|
|
|
if(!element.value) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(element.value === router.params.project) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-21 06:55:51 +00:00
|
|
|
return router.change('/console/home?project=' + element.value);
|
2019-08-21 19:22:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
element.addEventListener('change', function() {
|
|
|
|
|
check();
|
2019-05-09 06:54:39 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})(window);
|