Skip to content

Commit

Permalink
Mobile version: Break line instead of shortening
Browse files Browse the repository at this point in the history
  • Loading branch information
codeling committed Jan 11, 2024
1 parent b5654b2 commit a4dab50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 5 additions & 0 deletions todo-mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ img.ui-datepicker-trigger {
display: inline-block;
margin-right: 20px;
}
.todotitleonly {
display: inline-block;
width: 250px;
white-space: normal;
}
12 changes: 1 addition & 11 deletions todo-mobile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// source: http://stackoverflow.com/questions/1199352/smart-way-to-shorten-long-strings-with-javascript
String.prototype.trunc =
function(n,useWordBoundary){
var toLong = this.length>n,
s_ = toLong ? this.substr(0,n-1) : this;
s_ = useWordBoundary && toLong ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
return toLong ? s_ + '…' : s_;
};

/*
$(document).on("pagebeforeshow", '#modifyPage', function(e, data) {
alert(JSON.stringify(data).replace(/,/g,"\n").replace(/[{}\"]/g, ""));
Expand Down Expand Up @@ -52,8 +43,7 @@ function renderItem(it, lineNr) {
'<span class="todo" title="'+$T('CREATED')+': '+formatDate(createDate, true)+
'; '+$T('RECURRENCE')+': '+repetition+
((it.completed != 0)? '; '+$T('DONE')+': '+formatDate(complDate, true):'')+
'">'+
it.todo.trunc(30, false)+
'"><span class="todotitleonly">'+ it.todo+'</span>'+
(hasNote ? '<img src="images/note.png" />':'')+
(isRecurring ? '<img src="images/recurring.png" id="reactivate'+it.id+'" />':'')+
((it.completed==0 && dueDate != null && (today - dueDate) > 0) ?
Expand Down

0 comments on commit a4dab50

Please sign in to comment.