mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Add listener for may-blank, may-blank-within classes based on JS config.
This commit is contained in:
@@ -32,6 +32,15 @@ r.ui.init = function() {
|
||||
$(el).data('SubredditSubmitText', new r.ui.SubredditSubmitText({el: el}))
|
||||
})
|
||||
|
||||
if (r.config.new_window) {
|
||||
$(document.body).on('click', 'a.may-blank, .may-blank-within a', function() {
|
||||
if (!this.target) {
|
||||
this.target = '_blank'
|
||||
}
|
||||
return true // continue bubbling
|
||||
})
|
||||
}
|
||||
|
||||
r.ui.PermissionEditor.init()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user