Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindavid committed Sep 13, 2019
1 parent f6dc006 commit b702198
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/web/assets/pluginstore/dist/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/pluginstore/dist/js/app.js.map

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions src/web/assets/pluginstore/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,29 @@ Garnish.$doc.ready(function() {
*/
initializeOuterComponents() {
// Header Title
let $this = this
this.$headerTitle = $('#header h1');
this.$headerTitle.on('click', function() {
$this.$router.push({path: '/'})
})
this.$router.push({path: '/'})
}.bind(this))

// Cart button
this.$cartButton = $('#cart-button')

this.$cartButton.on('click', (e) => {
this.$cartButton.on('click', function(e) {
e.preventDefault()
$this.openModal('cart')
})
this.openModal('cart')
}.bind(this))

this.$cartButton.keydown(e => {
this.$cartButton.keydown(function(e) {
switch (e.which) {
case 13: // Enter
case 32: // Space
e.preventDefault()
$this.openModal('cart')
this.openModal('cart')
break

}
})
}.bind(this))

// Plugin Store actions
this.$pluginStoreActions = $('#pluginstore-actions')
Expand Down

0 comments on commit b702198

Please # to comment.