Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8745e6

Browse files
committed
Cleanups.
1 parent 94410dc commit a8745e6

File tree

6 files changed

+13
-25
lines changed

6 files changed

+13
-25
lines changed

demo/demo.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ function hideUIModel(){
7777
}
7878

7979
function showApp(entity, view){
80-
$('#title').html(uiModels[entity].label);
81-
window.location.href = '#'+entity+'/'+(view||'list');
80+
var m=uiModels[entity];
81+
if(m){
82+
$('#title').html(m.label);
83+
window.location.href = '#'+entity+'/'+(view||'list');
84+
}else{
85+
alert('App not defined "'+entity+'".');
86+
}
8287
}

demo/index.html

-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ <h1 id="title">Demos</h1>
7878
<div style="display:none;" id="uimodel"></div>
7979

8080
<p>If you are really curious, you may want to play with the <a href="test.html#test/list">Test Object</a> which is a contrived object with fields of all possible field types.
81-
82-
You can also <a href="custom-app.html">customize the UI-model</a> to see how the views change accordingly.
8381
</p>
8482

8583
<p>The data for these demos is stored in your browser's local storage

js/dico/dom.js

+1-16
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,7 @@ Evol.DOM = {
175175
}
176176
});
177177
return opts;
178-
}/*,
179-
180-
toggle: function (items) {
181-
var h=['<div class="btn-group" data-toggle="buttons">'];
182-
_.each(items, function(item){
183-
h.push('<label class="btn btn-info"><input type="radio" name="options" id="',item.id,'">',item.text,'</label>');
184-
});
185-
h.push('</div>');
186-
return h.join('');
187-
},*/
178+
}
188179
},
189180

190181
toggleCheckbox: function($cb, v){
@@ -211,13 +202,7 @@ Evol.DOM = {
211202
},
212203
buttonsPlusMinus: function(){
213204
return this.buttonsPlus()+this.buttonsMinus();
214-
},/*
215-
buttonsPrev: function(){
216-
return this.buttonsIcon('bPrev', 'chevron-left');
217205
},
218-
buttonsNext: function(){
219-
return this.buttonsIcon('bNext', 'chevron-right');
220-
},*/
221206

222207
// --- links ---
223208
link: function (id, label, url, target) {

js/dico/format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Evol.Format = {
8181
dd={"error": "Evol.Format.jsonString"};
8282
}
8383
if(dd===''){
84-
return dd;
84+
return dd;
8585
}else{
8686
//var txt=JSON.stringify(dd, null, '\t');
8787
var txt=JSON.stringify(dd, null, 2);

js/i18n/EN.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Evolutility-UI-jQuery Localization Library ENGLISH
22
// https://github.com/evoluteur/evolutility-ui-jquery
3-
// (c) 2015 Olivier Giulieri
3+
// (c) 2017 Olivier Giulieri
44

55
var Evol = Evol || {};
66

js/view-action/toolbar.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,14 @@ return Backbone.View.extend({
133133
var h,
134134
isReadOnly=this.readonly!==false,
135135
that=this,
136+
itemName=this.uiModel.name||'item',
136137
domm=dom.menu,
137138
tb=this.buttons,
138139
menuDivider='<li class="divider" data-cardi="x"></li>',
139140
menuDividerH='<li class="divider-h"></li>';
140141

141142
function menuItem (m, noLabel){
142-
return domm.hItem(m.id, noLabel?'':m.label, m.icon, m.n);
143+
return domm.hItem(m.id, noLabel?'':((m.label=='New'?'New '+itemName:m.label)), m.icon, m.n);
143144
}
144145
function menuItems (ms, noLabel){
145146
return _.map(ms, function(m){
@@ -315,8 +316,7 @@ return Backbone.View.extend({
315316
collection: this.collection,
316317
style: this.style,
317318
titleSelector: this.titleSelector,
318-
router: this.router//,
319-
//iconsPath: this.iconsPath || ''
319+
router: this.router
320320
};
321321
vw = new ViewClass(config).render();
322322
break;

0 commit comments

Comments
 (0)