make notes widget fixed height because it still doesn't play well with stickykit and I've wasted too much time trying to bludgeon it into submission.

This commit is contained in:
zotlabs 2019-06-25 16:11:22 -07:00
parent 11398d0da7
commit 0ced43b90d
2 changed files with 15 additions and 10 deletions

View file

@ -13,25 +13,30 @@ class Poster extends Controller {
$nick = argv(1);
$hash = argv(2);
if(! ($nick && $hash)) {
if (! ($nick && $hash)) {
return;
}
$u = channelx_by_nick($nick);
if (! $u) {
return;
}
$sql_extra = permissions_sql(intval($u['channel_id']));
$r = q("select content from attach where hash = '%s' and uid = %d and os_storage = 1 $sql_extra limit 1",
dbesc($hash),
intval($u['channel_id'])
);
if($r) {
if ($r) {
$path = dbunescbin($r[0]['content']);
if($path && @file_exists($path . '.thumb')) {
if ($path && @file_exists($path . '.thumb')) {
header('Content-Type: image/jpeg');
echo file_get_contents($path . '.thumb');
killme();
}
}
killme();
}
}

View file

@ -1,16 +1,16 @@
<div class="widget">
<h3>{{$banner}}</h3>
<textarea name="note_text" id="note-text">{{$text}}</textarea>
<textarea name="note_text" style="height: 250px;" id="note-text">{{$text}}</textarea>
<script>
var noteSaveTimer = null;
var noteText = $('#note-text');
$(document).ready(function(e){
noteText.on('change keyup keydown paste cut', function () {
noteText.height(0).height(noteText[0].scrollHeight);
$(document.body).trigger("sticky_kit:recalc");
}).change();
});
// $(document).ready(function(e){
// noteText.on('change keyup keydown paste cut', function () {
// noteText.height(0).height(noteText[0].scrollHeight);
// // $(document.body).trigger("sticky_kit:recalc");
// }).change();
// });
$(document).on('focusout',"#note-text",function(e){
if(noteSaveTimer)