From 84dbb47ea8493791a4c840fce0e5e9fe57aa9dd9 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 8 Feb 2012 01:45:37 +0100 Subject: [PATCH] Sync persona between tabs only if the QR's closed. Close #191 --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 55d88f130..fea38dfc1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1649,7 +1649,7 @@ } $.sync('qr.persona', function(persona) { var key, val, _results; - if (qr.replies.length !== 1) return; + if (!qr.el.hidden) return; _results = []; for (key in persona) { val = persona[key]; diff --git a/script.coffee b/script.coffee index 96e128386..d569fc9f1 100644 --- a/script.coffee +++ b/script.coffee @@ -1234,7 +1234,7 @@ qr = $.on input, 'change', -> qr.selected[@name] = @value # sync between tabs $.sync 'qr.persona', (persona) -> - return if qr.replies.length isnt 1 + return unless qr.el.hidden for key, val of persona qr.selected[key] = val $("[name=#{key}]", qr.el).value = val