don't expand image or inline quote if e.metaKey

on osx, command(⌘)+click opens links in new tabs.
e.metaKey is true when command is held.
This commit is contained in:
James Campos 2011-12-31 13:32:52 -08:00
parent 2114c86866
commit 5bda49fb79
2 changed files with 8 additions and 4 deletions

View File

@ -2457,7 +2457,9 @@
},
toggle: function(e) {
var id;
if (e.shiftKey || e.altKey || e.ctrlKey || e.button !== 0) return;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
id = this.hash.slice(1);
if (/\binlined\b/.test(this.className)) {
@ -2933,7 +2935,9 @@
},
cb: {
toggle: function(e) {
if (e.shiftKey || e.altKey || e.ctrlKey || e.button !== 0) return;
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) {
return;
}
e.preventDefault();
return imgExpand.toggle(this);
},

View File

@ -1944,7 +1944,7 @@ quoteInline =
quote.removeAttribute 'onclick'
$.on quote, 'click', quoteInline.toggle
toggle: (e) ->
return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
e.preventDefault()
id = @hash[1..]
if /\binlined\b/.test @className
@ -2279,7 +2279,7 @@ imgExpand =
imgExpand.expand a.firstChild
cb:
toggle: (e) ->
return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
e.preventDefault()
imgExpand.toggle @
all: ->