Skip to content
Browse files

Anzahl der key verschobe in anderen View Filter deaktiviert

  • Loading branch information...
1 parent 4dca778 commit af956f9b370b991cb3be6d639efcbfbbbd7c7737 Stephan committed Dec 7, 2012
Showing with 26 additions and 19 deletions.
  1. +18 −7 app/modules/localeEdit/views.js
  2. +4 −9 app/templates/localeedit/edit.html
  3. +4 −3 app/templates/localeedit/filter.html
View
25 app/modules/localeEdit/views.js
@@ -65,27 +65,33 @@ function(app, LocaleEdit, Backbone) {
this.currentPage = page;
this.render();
- $('#SelElementsPerPage option:selected').removeAttr('selected');
+
+ $('#SelElementsPerPage option:selected').removeAttr('selected');
var currentSelected = this.elementsPerPage;
$("#SelElementsPerPage option").filter(function() {
return $(this).val() == currentSelected;
}).attr('selected', true);
$('#SelElementsPerPage').val(this.elementsPerPage);
},
+ keyCountChanged: function(count){
+ this.keyCount = count;
+ this.render();
+ },
data: function() {
return {
currentpage: this.currentPage,
- elementsPerPage: this.elementsPerPage
+ elementsPerPage: this.elementsPerPage,
+ keyCount : this.keyCount
};
},
initialize: function(){
this.currentPage = 1;
-
this.elementsPerPage = 5;
- console.log('filter view elementsPerPage : ' + this.elementsPerPage);
+ this.keyCountChanged = 0;
mediator.Subscribe('pageChanged', this.pageChanged, {}, this)
-
+ mediator.Subscribe('localeKeyCountChanged', this.keyCountChanged, {}, this)
+
},
template: 'app/templates/localeedit/filter',
manage: true
@@ -183,7 +189,7 @@ Views.EditList = Backbone.View.extend({
var count = 0;
var start = (this.currentPage * this.pageSize) - this.pageSize;
var index = 0;
- console.log('rendering with page size :' + this.pageSize);
+
this.collection.each(function(locale) {
index +=1;
@@ -230,7 +236,7 @@ Views.EditList = Backbone.View.extend({
this.goToPage(Math.round(this.collection.length / this.pageSize) +1 );
},
changeElementsPerPage:function(pageSize){
- console.log('setting page size to:' + Number(pageSize));
+
this.pageSize = Number(pageSize);
this.render();
},
@@ -244,6 +250,11 @@ Views.EditList = Backbone.View.extend({
mediator.Subscribe('goToEnd', this.goToEnd, {}, this) ;
mediator.Subscribe('elementsPerPageCHanged', this.changeElementsPerPage, {}, this);
+ this.collection.on("reset", function(){
+ mediator.Publish('localeKeyCountChanged', this.collection.length);
+ }, this);
+
+
this.pageSize = 5;
this.currentPage = 1;
}
View
13 app/templates/localeedit/edit.html
@@ -1,16 +1,10 @@
- <div class="row" style="padding: 0 0 0 40px;">
+ <div class="row" style="padding: 0 0 12px 40px;">
+
<div class="pull-left">
-<% if (count) { %>
- <h4>Anzahl der Locale Keys (<%= count %>)</h4>
- <hr>
-<% } else { %>
- <!-- <h4>No Locales found.</h4> -->
-
-<% } %>
- </div>
+ </div>
<div class="pull-right">
<button id="SaveBtn" class="btn btn-primary save">
<i class=" icon-ok icon-white"></i>
@@ -21,6 +15,7 @@
<span>Reload</span>
</button>
</diV>
+
</div>
<div class="filter"></div>
View
7 app/templates/localeedit/filter.html
@@ -3,9 +3,9 @@
<div class="row" style="padding: 0 0 0 40px;">
<div class="pull-left">
- <input id="keySearchTask" class="input-medium" type="text" placeholder="KEY" value='<%= keySearchterm %>'></input>
- <input class="input-medium" type="text" placeholder="LANGUAGE"></input>
- <input class="input-medium" type="text" placeholder="VALUE"></input>
+ <input id="keySearchTask" disabled class="input-medium" type="text" placeholder="KEY" value='<%= keySearchterm %>'></input>
+ <input class="input-medium" disabled type="text" placeholder="LANGUAGE"></input>
+ <input class="input-medium" disabled type="text" placeholder="VALUE"></input>
</div>
<div class="pull-right filter">
@@ -23,6 +23,7 @@
<span id="gotoStart" class="label">Start</span>
<span id="gotoEnd" class="label">Ende</span>
<span class="label current-page">Seite: <%= currentpage %></span>
+ <span class="label current-page">Locale Edit Key Count: <%= keyCount %></span>
</div>
<div class="clearfix"></div>

0 comments on commit af956f9

Please sign in to comment.
Something went wrong with that request. Please try again.