Skip to content

Commit

Permalink
Limit image caption text characters (#343)
Browse files Browse the repository at this point in the history
- Limit caption text input to 1000 characters (fixes #18)
- Show only one line of the caption text in the mediabox (fixes #319)
  • Loading branch information
sillych authored and dbrgn committed Sep 14, 2017
1 parent 42ec03b commit 2aa8546
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/directives/mediabox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default [
<md-icon class="close material-icons md-24" ng-click="ctrl.close()" aria-label="Close" translate-attr="{'aria-label': 'common.CLOSE', 'title': 'common.CLOSE'}">close</md-icon>
<div class="inner" ng-click="ctrl.close($event)">
<img ng-src="{{ ctrl.imageDataUrl }}">
<div class="caption">
<div class="caption" title="{{ ctrl.caption | escapeHtml}}">
<span ng-bind-html="ctrl.caption | escapeHtml | markify | emojify"></span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/partials/messenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class ConversationController {
<md-dialog-content class="md-dialog-content">
<h2 class="md-title">${title}</h2>
<md-input-container md-no-float class="input-caption md-prompt-input-container" ng-show="!${showSendAsFileCheckbox} || ctrl.sendAsFile || ${captionSupported}">
<input md-autofocus ng-keypress="ctrl.keypress($event)" ng-model="ctrl.caption" placeholder="${placeholder}" aria-label="${placeholder}">
<input maxlength="1000" md-autofocus ng-keypress="ctrl.keypress($event)" ng-model="ctrl.caption" placeholder="${placeholder}" aria-label="${placeholder}">
</md-input-container>
<md-input-container md-no-float class="input-send-as-file md-prompt-input-container" ng-show="${showSendAsFileCheckbox}">
<md-checkbox ng-model="ctrl.sendAsFile" aria-label="${confirmSendAsFile}">
Expand Down
8 changes: 5 additions & 3 deletions src/sass/components/_mediabox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ mediabox {
}

.caption {
display: flex;
align-items: flex-end;
height: 28px;
margin: 4px 0 0;
color: rgba(255, 255, 255, 0.8);
font-size: 1.3em;
display: block;
width: 90%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
Expand Down

2 comments on commit 2aa8546

@rugk
Copy link
Contributor

@rugk rugk commented on 2aa8546 Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you mentioned the right issue?

Limit caption text input to 1000 characters (fixes #18)

Issue 18 is "Scrolling up sometimes fails". This fixes the scrolling?

@dbrgn
Copy link
Contributor

@dbrgn dbrgn commented on 2aa8546 Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that should be #318. Typo on my side. Reopened #18.

Please sign in to comment.