update files

This commit is contained in:
nuintun 2015-11-24 14:07:42 +08:00
parent 18027aa3ef
commit 9e10fc0d56
2 changed files with 11 additions and 4 deletions

View File

@ -18,7 +18,7 @@
</a>
</li>
<li v-if="moreCommand.length" class="ui-command-more">
<a href="javascript:;" @click="commandToggle">更多&nbsp;<i class="icon-expand"></i></a>
<a v-el:expand-trigger href="javascript:;">更多&nbsp;<i class="icon-expand"></i></a>
<ul v-show="showMoreCommand" class="ui-command-popup">
<li v-for="moreCmd in moreCommand">
<a :title="moreCmd.name" href="javascript:;">

View File

@ -55,9 +55,6 @@ module.exports = Vue.component('app-main', {
setting: function (){
this.showSetting = true;
},
commandToggle: function (){
this.showMoreCommand = !this.showMoreCommand;
},
remove: function (){
this.projects.splice(this.activeIndex, 1);
this.activeIndex = 0;
@ -73,5 +70,15 @@ module.exports = Vue.component('app-main', {
this.projects.$set(this.activeIndex, project);
this.$dispatch('save-configure');
}
},
created: function (){
var context = this;
document.addEventListener('click', function (event){
var target = event.target;
var trigger = context.$els.expandTrigger;
context.showMoreCommand = !!trigger.contains(target);
});
}
});