Merge lp:~twstd-dev/ubuntu-clock-app/label-truncate into lp:ubuntu-clock-app

Proposed by twstd
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 60
Merged at revision: 59
Proposed branch: lp:~twstd-dev/ubuntu-clock-app/label-truncate
Merge into: lp:ubuntu-clock-app
Diff against target: 28 lines (+2/-16)
1 file modified
app/alarm/AlarmLabel.qml (+2/-16)
To merge this branch: bzr merge lp:~twstd-dev/ubuntu-clock-app/label-truncate
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Approve
Review via email: mp+231262@code.launchpad.net

Commit message

Simplified the alarm label page back button check function using javascript trim() function.

Description of the change

Simplified the alarm label page back button check function using javascript trim() function.

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Yup works as expected. Awesome!! Just a small code style tweak pls :P,

- onTextChanged: ( backAction.enabled = !!text.trim() )
+ onTextChanged: {
+ backAction.enabled = !!text.trim()
+ }

60. By twstd

Style change

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

LGTM! Thx for the code reduction. I love deleting code :D

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/AlarmLabel.qml'
2--- app/alarm/AlarmLabel.qml 2014-08-12 10:59:04 +0000
3+++ app/alarm/AlarmLabel.qml 2014-08-18 21:30:26 +0000
4@@ -50,22 +50,8 @@
5 width: parent.width
6 inputMethodHints: Qt.ImhNoPredictiveText
7
8- onTextChanged: {
9- backAction.enabled = false
10-
11- // If string is empty, reject it immediately
12- if(text === "") {
13- backAction.enabled = false
14- return
15- }
16-
17- // Check if strings contain only blank spaces. If yes reject.
18- for (var i=0; i < text.length; i++) {
19- if(text[i] !== " ") {
20- backAction.enabled = true
21- return
22- }
23- }
24+ onTextChanged: {
25+ backAction.enabled = !!text.trim()
26 }
27 }
28 }

Subscribers

People subscribed via source and target branches

to all changes: