Browse Source

remove share button in menu

fix https://github.com/lesspass/lesspass/issues/174
pull/342/head
Guillaume Vincent 7 years ago
parent
commit
31d5140072
3 changed files with 19 additions and 20 deletions
  1. +1
    -16
      src/components/Menu.vue
  2. +1
    -0
      src/services/tooltip.js
  3. +17
    -4
      src/views/PasswordGenerator.vue

+ 1
- 16
src/components/Menu.vue View File

@@ -28,10 +28,6 @@
v-if="!saved && isAuthenticated && $store.state.password.site !== ''"> v-if="!saved && isAuthenticated && $store.state.password.site !== ''">
<i class="fa fa-lg fa-save pointer"></i> <i class="fa fa-lg fa-save pointer"></i>
</span> </span>
<span class="white-link btn-copy pl-3" v-bind:data-clipboard-text="passwordURL"
v-if="$store.state.password.site !== ''">
<i class="fa fa-lg fa-share-alt pointer"></i>
</span>
<router-link class="white-link pl-3" :to="{ name: 'configureOptions'}"> <router-link class="white-link pl-3" :to="{ name: 'configureOptions'}">
<i class="fa fa-lg fa-cog" aria-hidden="true"></i> <i class="fa fa-lg fa-cog" aria-hidden="true"></i>
</router-link> </router-link>
@@ -52,8 +48,6 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
import Clipboard from 'clipboard';
import {showTooltip} from '../services/tooltip';


export default { export default {
data(){ data(){
@@ -61,14 +55,6 @@
saved: false saved: false
} }
}, },
created(){
const clipboard = new Clipboard('.btn-copy');
clipboard.on('success', event => {
if (event.text) {
showTooltip(event.trigger, this.$t('copied', 'copied !'));
}
});
},
methods: { methods: {
fullReload(){ fullReload(){
this.$store.dispatch('savePassword', {password: this.defaultPassword}); this.$store.dispatch('savePassword', {password: this.defaultPassword});
@@ -90,8 +76,7 @@
'isAuthenticated', 'isAuthenticated',
'isGuest', 'isGuest',
'password', 'password',
'defaultPassword',
'passwordURL'
'defaultPassword'
]) ])
} }
</script> </script>

+ 1
- 0
src/services/tooltip.js View File

@@ -4,5 +4,6 @@ export function showTooltip(elem, msg) {
elem.setAttribute('aria-label', msg); elem.setAttribute('aria-label', msg);
setTimeout(function() { setTimeout(function() {
elem.setAttribute('class', classNames); elem.setAttribute('class', classNames);
elem.setAttribute('aria-label', '');
}, 2000); }, 2000);
} }

+ 17
- 4
src/views/PasswordGenerator.vue View File

@@ -86,17 +86,24 @@
</button> </button>
</div> </div>
</div> </div>
<div class="col-9" v-show="generatedPassword">
<div class="col-8" v-show="generatedPassword">
<div class="input-group"> <div class="input-group">
<span class="input-group-btn"> <span class="input-group-btn">
<button id="copyPasswordButton" type="button" data-clipboard-text="" class="btn btn-copy"
<button id="copyPasswordButton"
class="btn btn-copy"
type="button"
data-clipboard-text=""
ref="copyPasswordButton" ref="copyPasswordButton"
v-bind:class="{ 'btn-warning': password.version===1, 'btn-primary': password.version===2 }"> v-bind:class="{ 'btn-warning': password.version===1, 'btn-primary': password.version===2 }">
<i class="fa fa-clipboard" aria-hidden="true"></i> <i class="fa fa-clipboard" aria-hidden="true"></i>
</button> </button>
</span> </span>
<input type="password" id="generated-password" class="form-control" tabindex="-1"
ref="generatedPassword" v-bind:value="generatedPassword"
<input id="generated-password"
type="password"
class="form-control"
tabindex="-1"
ref="generatedPassword"
v-bind:value="generatedPassword"
v-bind:class="{ 'btn-outline-warning': password.version===1, 'btn-outline-primary': password.version===2 }"> v-bind:class="{ 'btn-outline-warning': password.version===1, 'btn-outline-primary': password.version===2 }">
<span class="input-group-btn"> <span class="input-group-btn">
<button id="revealGeneratedPassword" type="button" class="btn" <button id="revealGeneratedPassword" type="button" class="btn"
@@ -108,6 +115,12 @@
</div> </div>
</div> </div>
<div class="col col-auto"> <div class="col col-auto">
<button class="btn btn-copy btn-secondary"
type="button"
v-bind:data-clipboard-text="passwordURL"
v-bind:disabled="password.site.length === 0">
<i class="fa fa-lg fa-share-alt pointer" aria-hidden="true"></i>
</button>
<button type="button" class="btn btn-secondary" v-on:click="showOptions=!showOptions"> <button type="button" class="btn btn-secondary" v-on:click="showOptions=!showOptions">
<i class="fa fa-sliders" aria-hidden="true"></i> <i class="fa fa-sliders" aria-hidden="true"></i>
</button> </button>


Loading…
Cancel
Save