Skip to content

Commit 8d3f071

Browse files
committed
updated: angular bootstrap ui
1 parent 4763bdc commit 8d3f071

9 files changed

Lines changed: 4279 additions & 3246 deletions

ne-modules-all.js

Lines changed: 2123 additions & 1609 deletions
Large diffs are not rendered by default.

ne-modules-all.min.js

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ne-modules-all.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ne-modules.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6252,19 +6252,9 @@ angular.module('neRest',['neObject','neNotifications','neLoading'])
62526252

62536253
if(query.$page === 0) throw new Error('NeRestResource: query.$page is equal to zero, must be greater');
62546254

6255-
// replace default pagination props by custom if defined
6256-
if(pageKey !== '$page'){
6257-
query = object.deepSet(query, pageKey, query.$page);
6258-
delete query.$page;
6259-
}
6260-
if(limitKey !== '$limit'){
6261-
query = object.deepSet(query, limitKey, query.$limit);
6262-
delete query.$limit;
6263-
}
6264-
if(sortKey !== '$sort'){
6265-
query = object.deepSet(query, sortKey, query.$sort);
6266-
delete query.$sort;
6267-
}
6255+
// replace default pagination props by custom if defined in query
6256+
query = replacePaginationProps(query, pageKey, limitKey, sortKey, object);
6257+
if(data) data = replacePaginationProps(data, pageKey, limitKey, sortKey, object);
62686258

62696259
var successCbs = [ successCb, cmdOpts.onSuccess, opts.onSuccess ];
62706260
var errorCbs = [ errorCb, cmdOpts.onError, opts.onError ];
@@ -6287,6 +6277,22 @@ angular.module('neRest',['neObject','neNotifications','neLoading'])
62876277
if(method === 'post-multipart' || method === 'upload') upload.call(resource, cmdName, query, httpOpts, successCbs, errorCbs, progressCbs);
62886278
else $http(httpOpts).then(handleSuccess(query, opts, cmdName, successCbs), handleError(query, opts, cmdName, errorCbs));
62896279
};
6280+
6281+
function replacePaginationProps(queryOrData, pageKey, limitKey, sortKey, object) {
6282+
if(pageKey !== '$page'){
6283+
queryOrData = object.deepSet(queryOrData, pageKey, queryOrData.$page);
6284+
delete queryOrData.$page;
6285+
}
6286+
if(limitKey !== '$limit'){
6287+
queryOrData = object.deepSet(queryOrData, limitKey, queryOrData.$limit);
6288+
delete queryOrData.$limit;
6289+
}
6290+
if(sortKey !== '$sort'){
6291+
queryOrData = object.deepSet(queryOrData, sortKey, queryOrData.$sort);
6292+
delete queryOrData.$sort;
6293+
}
6294+
return queryOrData;
6295+
}
62906296

62916297

62926298
/*
@@ -6354,7 +6360,7 @@ angular.module('neRest',['neObject','neNotifications','neLoading'])
63546360
function removePrefixedProps(input, prefix) {
63556361

63566362
// Ignore things that aren't objects.
6357-
if(typeof input !== 'object') return input;
6363+
if(typeof input !== 'object' || !prefix) return input;
63586364

63596365
for(var key in input) {
63606366
if(input.hasOwnProperty(key)) {

ne-modules.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ne-modules.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ne-rest.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -602,19 +602,9 @@ angular.module('neRest',['neObject','neNotifications','neLoading'])
602602

603603
if(query.$page === 0) throw new Error('NeRestResource: query.$page is equal to zero, must be greater');
604604

605-
// replace default pagination props by custom if defined
606-
if(pageKey !== '$page'){
607-
query = object.deepSet(query, pageKey, query.$page);
608-
delete query.$page;
609-
}
610-
if(limitKey !== '$limit'){
611-
query = object.deepSet(query, limitKey, query.$limit);
612-
delete query.$limit;
613-
}
614-
if(sortKey !== '$sort'){
615-
query = object.deepSet(query, sortKey, query.$sort);
616-
delete query.$sort;
617-
}
605+
// replace default pagination props by custom if defined in query
606+
query = replacePaginationProps(query, pageKey, limitKey, sortKey, object);
607+
if(data) data = replacePaginationProps(data, pageKey, limitKey, sortKey, object);
618608

619609
var successCbs = [ successCb, cmdOpts.onSuccess, opts.onSuccess ];
620610
var errorCbs = [ errorCb, cmdOpts.onError, opts.onError ];
@@ -637,6 +627,22 @@ angular.module('neRest',['neObject','neNotifications','neLoading'])
637627
if(method === 'post-multipart' || method === 'upload') upload.call(resource, cmdName, query, httpOpts, successCbs, errorCbs, progressCbs);
638628
else $http(httpOpts).then(handleSuccess(query, opts, cmdName, successCbs), handleError(query, opts, cmdName, errorCbs));
639629
};
630+
631+
function replacePaginationProps(queryOrData, pageKey, limitKey, sortKey, object) {
632+
if(pageKey !== '$page'){
633+
queryOrData = object.deepSet(queryOrData, pageKey, queryOrData.$page);
634+
delete queryOrData.$page;
635+
}
636+
if(limitKey !== '$limit'){
637+
queryOrData = object.deepSet(queryOrData, limitKey, queryOrData.$limit);
638+
delete queryOrData.$limit;
639+
}
640+
if(sortKey !== '$sort'){
641+
queryOrData = object.deepSet(queryOrData, sortKey, queryOrData.$sort);
642+
delete queryOrData.$sort;
643+
}
644+
return queryOrData;
645+
}
640646

641647

642648
/*
@@ -704,7 +710,7 @@ angular.module('neRest',['neObject','neNotifications','neLoading'])
704710
function removePrefixedProps(input, prefix) {
705711

706712
// Ignore things that aren't objects.
707-
if(typeof input !== 'object') return input;
713+
if(typeof input !== 'object' || !prefix) return input;
708714

709715
for(var key in input) {
710716
if(input.hasOwnProperty(key)) {

0 commit comments

Comments
 (0)