fix firefox focus bug on flagging dialog

This commit is contained in:
Sam Saffron 2013-02-06 11:47:08 +11:00
parent 1a7e2f14d4
commit 3fd019c6bd
3 changed files with 27 additions and 21 deletions

View File

@ -6,18 +6,21 @@
<label class='radio'>
<input type='radio' id="radio_{{unbound name_key}}" {{action changePostActionType this target="view"}} name='post_action_type_index'> <strong>{{name}}</strong>
{{#if is_custom_flag}}
{{#if view.isCustomFlag}}
{{view Ember.TextArea name="message" class="flag-message" placeholderBinding="view.customPlaceholder" valueBinding="view.customFlagMessage"}}
<div {{bindAttr class="view.customMessageLengthClasses"}}>{{view.customMessageLength}}</div>
{{else}}
{{#unless view.isCustomFlag}}
<div class='description'>{{{description}}}</div>
{{/if}}
{{/unless}}
{{else}}
{{#if description}}
<div class='description'>{{{description}}}</div>
{{/if}}
{{/if}}
</label>
{{#if is_custom_flag}}
{{#if view.isCustomFlag}}
{{view Ember.TextArea name="message" class="flag-message" placeholderBinding="view.customPlaceholder" valueBinding="view.customFlagMessage"}}
<div {{bindAttr class="view.customMessageLengthClasses"}}>{{view.customMessageLength}}</div>
{{/if}}
{{/if}}
</div>
{{/each}}
</form>

View File

@ -3,6 +3,8 @@ window.Discourse.FlagView = Ember.View.extend
title: Em.String.i18n('flagging.title')
changePostActionType: (action) ->
if @get('postActionTypeId') == action.id
return false
@set('postActionTypeId', action.id)
@set('isCustomFlag', action.is_custom_flag)
Em.run.next -> $("#radio_#{action.name_key}").prop('checked', 'true')
@ -40,7 +42,7 @@ window.Discourse.FlagView = Ember.View.extend
message = Em.String.i18n("flagging.custom_message.left", n: 500 - len)
@set("customMessageLengthClasses", "ok custom-message-length")
@set("customMessageLength",message)
return
).observes("customFlagMessage")
didInsertElement: ->
@ -51,3 +53,4 @@ window.Discourse.FlagView = Ember.View.extend
# Would be nice if there were an EmberJs radio button to do this for us. Oh well, one should be coming
# in an upcoming release.
$("input[type='radio']", $flagModal).prop('checked', false)
return

View File

@ -71,7 +71,7 @@ CREATE TABLE categories (
--
CREATE SEQUENCE categories_id_seq
START WITH 2
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -125,7 +125,7 @@ CREATE TABLE category_featured_users (
--
CREATE SEQUENCE category_featured_users_id_seq
START WITH 247
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -156,7 +156,7 @@ CREATE TABLE draft_sequences (
--
CREATE SEQUENCE draft_sequences_id_seq
START WITH 16
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -190,7 +190,7 @@ CREATE TABLE drafts (
--
CREATE SEQUENCE drafts_id_seq
START WITH 2
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -223,7 +223,7 @@ CREATE TABLE email_logs (
--
CREATE SEQUENCE email_logs_id_seq
START WITH 3
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -258,7 +258,7 @@ CREATE TABLE email_tokens (
--
CREATE SEQUENCE email_tokens_id_seq
START WITH 3
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -505,7 +505,7 @@ CREATE TABLE post_action_types (
--
CREATE SEQUENCE post_action_types_id_seq
START WITH 6
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -636,7 +636,7 @@ CREATE TABLE posts (
--
CREATE SEQUENCE posts_id_seq
START WITH 12
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -727,7 +727,7 @@ CREATE TABLE site_settings (
--
CREATE SEQUENCE site_settings_id_seq
START WITH 6
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -759,7 +759,7 @@ CREATE TABLE topic_allowed_users (
--
CREATE SEQUENCE topic_allowed_users_id_seq
START WITH 3
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -951,7 +951,7 @@ CREATE TABLE topics (
--
CREATE SEQUENCE topics_id_seq
START WITH 14
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -1057,7 +1057,7 @@ CREATE TABLE user_actions (
--
CREATE SEQUENCE user_actions_id_seq
START WITH 27
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -1121,7 +1121,7 @@ CREATE TABLE user_visits (
--
CREATE SEQUENCE user_visits_id_seq
START WITH 6
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -1187,7 +1187,7 @@ CREATE TABLE users (
--
CREATE SEQUENCE users_id_seq
START WITH 3
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
@ -1236,7 +1236,7 @@ CREATE TABLE versions (
--
CREATE SEQUENCE versions_id_seq
START WITH 2
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE