angular-sortablejs
Advanced tools
Comparing version
import { Directive, ElementRef, Input, NgZone } from '@angular/core'; | ||
import { GLOBALS } from './globals'; | ||
import { SortablejsService } from './sortablejs.service'; | ||
import { SortablejsModule } from './sortablejs.module'; | ||
import * as Sortable from 'sortablejs/Sortable.min'; | ||
// original library calls the events in unnatural order | ||
// first the item is added, then removed from the previous array | ||
// this is a temporary event to work this around | ||
// as long as only one sortable takes place at a certain time | ||
// this is enough to have a single `global` event | ||
var onremove; | ||
var SortablejsDirective = (function () { | ||
@@ -48,3 +42,3 @@ function SortablejsDirective(sortablejsService, element, zone) { | ||
get: function () { | ||
return Object.assign({}, SortablejsModule._globalOptions, this.inputOptions, this.overridenOptions); | ||
return Object.assign({}, GLOBALS.options, this.inputOptions, this.overridenOptions); | ||
}, | ||
@@ -51,0 +45,0 @@ enumerable: true, |
import { ModuleWithProviders } from '@angular/core'; | ||
import { SortablejsOptions } from './sortablejs-options'; | ||
export declare class SortablejsModule { | ||
static _globalOptions: SortablejsOptions; | ||
static forRoot(globalOptions: SortablejsOptions): ModuleWithProviders; | ||
} |
import { NgModule } from '@angular/core'; | ||
import { GLOBALS } from './globals'; | ||
import { SortablejsDirective } from './sortablejs.directive'; | ||
@@ -8,3 +9,3 @@ import { SortablejsService } from './sortablejs.service'; | ||
SortablejsModule.forRoot = function (globalOptions) { | ||
SortablejsModule._globalOptions = globalOptions; | ||
GLOBALS.options = globalOptions; | ||
return { | ||
@@ -20,3 +21,2 @@ ngModule: SortablejsModule, | ||
export { SortablejsModule }; | ||
SortablejsModule._globalOptions = {}; | ||
SortablejsModule.decorators = [ | ||
@@ -23,0 +23,0 @@ { type: NgModule, args: [{ |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"SortablejsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"exports":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"providers":[{"__symbolic":"reference","module":"./sortablejs.service","name":"SortablejsService"}]}]}],"statics":{"_globalOptions":{}}}}},{"__symbolic":"module","version":1,"metadata":{"SortablejsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"exports":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"providers":[{"__symbolic":"reference","module":"./sortablejs.service","name":"SortablejsService"}]}]}],"statics":{"_globalOptions":{}}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"SortablejsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"exports":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"providers":[{"__symbolic":"reference","module":"./sortablejs.service","name":"SortablejsService"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"SortablejsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"exports":[{"__symbolic":"reference","module":"./sortablejs.directive","name":"SortablejsDirective"}],"providers":[{"__symbolic":"reference","module":"./sortablejs.service","name":"SortablejsService"}]}]}]}}}] |
{ | ||
"name": "angular-sortablejs", | ||
"version": "2.0.1-0", | ||
"version": "2.0.1-1", | ||
"description": "SortableJS for Angular", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26
18.18%28741
-0.07%