Merge lp:~vthompson/communitycast/only-144-on-client into lp:communitycast/client

Proposed by Victor Thompson
Status: Needs review
Proposed branch: lp:~vthompson/communitycast/only-144-on-client
Merge into: lp:communitycast/client
Diff against target: 27 lines (+17/-0)
1 file modified
components/MessageComposerPage.qml (+17/-0)
To merge this branch: bzr merge lp:~vthompson/communitycast/only-144-on-client
Reviewer Review Type Date Requested Status
Michael Hall Pending
Review via email: mp+212839@code.launchpad.net

Commit message

Only allow 144 characters on client

Description of the change

Only allow 144 characters on client

To post a comment you must log in.

Unmerged revisions

7. By Victor Thompson

Only allow 144 characters

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/MessageComposerPage.qml'
2--- components/MessageComposerPage.qml 2014-03-23 21:27:47 +0000
3+++ components/MessageComposerPage.qml 2014-03-26 13:05:56 +0000
4@@ -12,6 +12,23 @@
5 id: commentField
6 width: parent.width
7 placeholderText: 'Type your message here...'
8+
9+ onTextChanged: {
10+ if (!readOnly && text.length > 144)
11+ {
12+ var pos = cursorPosition
13+ if (cursorPosition >= text.length)
14+ {
15+ text = text.slice(0, 144 - text.length)
16+ cursorPosition = text.length
17+ }
18+ else
19+ {
20+ text = text.slice(0,cursorPosition-1) + text.slice(cursorPosition)
21+ cursorPosition = pos - 1
22+ }
23+ }
24+ }
25 }
26
27 Button {

Subscribers

People subscribed via source and target branches

to all changes: