Skip to content

Not compatible with angular-legacy-sortablejs when update form 1.9.0 to 1.10.0 #1728

@ChuckIsReady

Description

@ChuckIsReady

Problem:

in version 1.9.0, i use angular-legacy-sortablejs by setting this on index.js (with webpack)

require('angular-legacy-sortablejs-maintained/angular-legacy-sortable.js');

after i update to 1.10.0 there is a error on console:

TypeError: Sortable.create is not a function

image

Then i find 1.10.0 is completely reconstructed.

in 1.9.0 :

(function sortableModule(factory) {
	"use strict";

	if (typeof define === "function" && define.amd) {
		define(factory);
	}
	else if (typeof module != "undefined" && typeof module.exports != "undefined") {
		module.exports = factory();
	}
	else {
		/* jshint sub:true */
		window["Sortable"] = factory();
	}
})(...)

in 1.10.0 :

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = global || self, global.Sortable = factory());
}(this, function (){...})

and angular-legacy-sortablejs get sortablejs by this way:

(function (factory) {
	'use strict';

	if (typeof define === 'function' && define.amd) {
		define(['angular', 'sortablejs'], factory);
	}
	else if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
		require('angular');
		factory(angular, require('sortablejs'));
		module.exports = 'ng-sortable';
	}
	else if (window.angular && window.Sortable) {
		factory(angular, Sortable);
	}
})(function (angular, Sortable) {...}

So can you think about adding some conditions so that sortablejs can continue to be used by angular-legacy-sortablejs

thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions