mirror of
https://github.com/flarum/framework.git
synced 2025-05-10 15:30:42 +08:00
Tweak user bio editing styles
This commit is contained in:
parent
cce21bb184
commit
066f9df18f
@ -24,10 +24,14 @@ export default Ember.Component.extend({
|
|||||||
|
|
||||||
this.set('editing', true);
|
this.set('editing', true);
|
||||||
var component = this;
|
var component = this;
|
||||||
|
var height = this.$().height();
|
||||||
Ember.run.scheduleOnce('afterRender', this, function() {
|
Ember.run.scheduleOnce('afterRender', this, function() {
|
||||||
this.$('textarea').focus().blur(function() {
|
var save = function(e) {
|
||||||
|
if (e.shiftKey) { return; }
|
||||||
|
e.preventDefault();
|
||||||
component.send('save', $(this).val());
|
component.send('save', $(this).val());
|
||||||
});
|
};
|
||||||
|
this.$('textarea').css('height', height).focus().bind('blur', save).bind('keydown', 'return', save);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -70,25 +70,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
& .user-bio {
|
& .user-bio {
|
||||||
padding: 10px 10px 1px;
|
|
||||||
margin: -10px -10px 10px;
|
margin: -10px -10px 10px;
|
||||||
|
border: 1px dashed transparent;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
|
||||||
&.editable:not(.editing) {
|
&.editable:not(.editing) {
|
||||||
cursor: text;
|
cursor: text;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border: 1px dashed rgba(255, 255, 255, 0.5);
|
border-color: rgba(255, 255, 255, 0.5);
|
||||||
border-radius: @border-radius-base;
|
|
||||||
padding: 9px 9px 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bio-content {
|
||||||
|
padding: 10px 10px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
&, & textarea {
|
&, & textarea {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
& textarea {
|
& textarea {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: -10px -10px 0;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
{{#if editing}}
|
{{#if editing}}
|
||||||
{{textarea value=user.bio class="form-control"}}
|
{{textarea value=user.bio class="form-control"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if user.bioHtml}}
|
<div class="bio-content">
|
||||||
{{{user.bioHtml}}}
|
{{#if user.bioHtml}}
|
||||||
{{else if isEditable}}
|
{{{user.bioHtml}}}
|
||||||
<p>Write something about yourself...</p>
|
{{else if isEditable}}
|
||||||
{{/if}}
|
<p>Write something about yourself...</p>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user