views/engine2actions.coffee in engine2-1.0.0 vs views/engine2actions.coffee in engine2-1.0.1

- old
+ new

@@ -24,11 +24,11 @@ .factory 'E2Actions', (E2, $http, $timeout, $e2Modal, $injector, $compile, $templateCache, $q, localStorageService, $route, $window, $rootScope, $location) -> action: class Action constructor: (response, scope, parent, element, action_info) -> @find_action_info = (name, raise = true) -> act = response.actions[name] - throw "Undefined action '#{name}' for action #{@action_info().name} (under #{@parent().action_info().action_resource})" if raise && !act + throw "Undefined action '#{name}' for action #{@action_info().name} (under #{@parent()?.action_info().action_resource})" if raise && !act act _.each response.actions, (act, nm) -> act.name = nm @meta = response.meta (@scope = -> scope) if scope @@ -305,10 +305,10 @@ super() @query = page: 0, asc: true, search: {} #, search_tab: 0 @ui_state = {} @load_state() - delete @query.order unless _.includes(@meta.fields, @query.order) + delete @query.order unless @meta.info[@query.order]?.sort # _.includes(@meta.fields, @query.order) _.each @query.search, ((sv, sn) => delete @query.search[sn] unless _.includes(@meta.search_fields, sn)) _.each @meta.info, (info, name) => if info.remote_onchange @scope().$watch (=> @query.search?[name]), (n) => if n?