Commit f11b35cf authored by zauberstuhl's avatar zauberstuhl

Tune post editor js and css

parent ea30a818
......@@ -3,13 +3,12 @@
(function() {
API.aspects.get().then(function(aspects) {
$.each(aspects, function(i, aspect) {
var li = $('<li><a href="#"></a></li>');
li.find("a").html(aspect.Name);
li.click(function() {
$(".dropdown button").html(li.text() + ' <span class="caret"></span>');
$("#aspectID").val(aspect.ID);
});
$(".dropdown .dropdown-menu").prepend(li);
$('#aspect-list').append(
$('<option>', {
value: aspect.ID,
text : aspect.Name
})
);
});
});
})();
//= require javascripts/api
//= require javascripts/stream_editor_box
(function(){
var infiniteScroll = {
......
$('textarea.compressed').focus(function () {
$(this).removeClass('compressed');
$(this).addClass('expanded');
$(this).focusout(function() {
$(this).removeClass('expanded');
$(this).addClass('compressed');
});
});
/*
*= require stylesheets/reshare_box
*= require stylesheets/stream_editor_box
*/
html {
......
.nopadding-right {
padding-right: 0 !important;
margin-right: 0 !important;
}
.nopadding-left {
padding-left: 0 !important;
margin-left: 0 !important;
}
.form-control.compressed {
height: 4em;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.form-control.expanded {
height: 12em;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
select.form-control {
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
appearance: none;
color: #fff;
background-color: #337ab7;
}
......@@ -2,23 +2,20 @@
<div class="form-group">
<div class="row">
<div class="col-md-12">
<input id="aspectID" name="aspectID" type="hidden" value="0">
<textarea class="form-control" rows="5" name="post" placeholder="I like cats !!"></textarea>
<textarea class="form-control compressed" name="post" placeholder="I like cats !!"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="col-md-10 nopadding-right">
<button class="btn btn-primary btn-large btn-block" type="submit">
<span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span> Post It
</button>
</div>
<div class="col-md-2">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Select an Aspect <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a class="toggle-create-aspect" href="#">Public</a></li>
</ul>
<div class="form-group">
<select id="aspect-list" name="aspectID" class="form-control">
<option value="0">Public</option>
</select>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment