Skip to content

Commit

Permalink
fix: drop deprecated jquery functions
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Dec 30, 2024
1 parent 575300c commit ca2ed7d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 32 deletions.
7 changes: 3 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
*/
module.exports = {
extends: [
'@nextcloud'
'@nextcloud',
],
globals: {
'$': true
},
rules: {
'no-control-regex': 1
}
'no-control-regex': 'warn',
},
}
15 changes: 0 additions & 15 deletions src/Components/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,9 @@ export default {
})

// emit event to current app
this.$parent._$el.fadeOut(OC.menuSpeed)
this.$parent.$emit('remove', this.notificationIndex)

emit('notifications:action:executed', event)

try {
$('body').trigger(new $.Event('OCA.Notification.Action', {
notification: this.$parent,
action: {
url: this.link,
type: this.typeWithDefault,
},
}))
// do not do anything but log, the action went fine
// only the event bus listener failed, this is not our problem
} catch (error) {
console.error(error)
}
} catch (error) {
console.error('Failed to perform action', error)
showError(t('notifications', 'Failed to perform action'))
Expand Down
6 changes: 0 additions & 6 deletions src/Components/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ export default {
}
},

_$el: null,

computed: {
timestamp() {
if (this.datetime === 'warning') {
Expand Down Expand Up @@ -246,10 +244,6 @@ export default {
},
},

mounted() {
this._$el = $(this.$el)
},

methods: {
prepareParameters(parameters) {
const richParameters = {}
Expand Down
7 changes: 0 additions & 7 deletions src/NotificationsApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ export default {
}
},

_$icon: null,

computed: {
showBrowserNotifications() {
return this.backgroundFetching
Expand Down Expand Up @@ -194,13 +192,8 @@ export default {

mounted() {
this.tabId = OC.requestToken || ('' + Math.random())
this._$icon = $(this.$refs.icon)
this._oldcount = 0

// Bind the button click event
console.debug('Registering notifications container as a menu')
OC.registerMenu($(this.$refs.button), $(this.$refs.container), undefined, true)

this.checkWebNotificationPermissions()

// Initial call to the notification endpoint
Expand Down

0 comments on commit ca2ed7d

Please sign in to comment.