extended-spine-di
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "extended-spine-di", | ||
"description": "Some extensions for spine framework with dependency injection", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"author": { | ||
@@ -25,3 +25,3 @@ "name": "David Kudera", | ||
"dependencies": { | ||
"extended-spine": "~1.0.4", | ||
"extended-spine": "~1.1.0", | ||
"dependency-injection": "~1.6.1" | ||
@@ -28,0 +28,0 @@ }, |
@@ -48,3 +48,3 @@ # extended-spine-di | ||
* 1.0.3 | ||
* 1.0.3 - 1.0.4 | ||
+ Some updates | ||
@@ -51,0 +51,0 @@ |
@@ -204,3 +204,3 @@ /** Generated by SimQ **/ | ||
(function() { | ||
var $, Controller, Spine, isMobile, | ||
var $, Controller, Spine, hasAttr, isMobile, num, | ||
__hasProp = {}.hasOwnProperty, | ||
@@ -215,5 +215,15 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
num = 0; | ||
hasAttr = function(el, name) { | ||
var attr; | ||
attr = $(el).attr(name); | ||
return typeof attr !== 'undefined' && attr !== false; | ||
}; | ||
Controller = (function(_super) { | ||
__extends(Controller, _super); | ||
Controller.prototype.id = null; | ||
function Controller(el) { | ||
@@ -227,2 +237,3 @@ if (el == null) { | ||
Controller.__super__.constructor.call(this, this, []); | ||
this.id = this.el.attr('id'); | ||
this.el.data('controller', this); | ||
@@ -236,7 +247,2 @@ } | ||
$ = jQuery; | ||
$.fn.hasAttr = function(name) { | ||
var attr; | ||
attr = $(this).attr(name); | ||
return typeof attr !== 'undefined' && attr !== false; | ||
}; | ||
$.fn.getController = function() { | ||
@@ -298,3 +304,3 @@ return $(this).data('controller'); | ||
result = []; | ||
if (scope.hasAttr('data-controller')) { | ||
if (hasAttr(scope, 'data-controller')) { | ||
result.push(scope); | ||
@@ -349,4 +355,4 @@ } | ||
} | ||
computer = el.hasAttr('data-computer'); | ||
mobile = el.hasAttr('data-mobile'); | ||
computer = hasAttr(el, 'data-computer'); | ||
mobile = hasAttr(el, 'data-mobile'); | ||
if (el !== null && (computer || mobile)) { | ||
@@ -360,2 +366,6 @@ if (computer && isMobile()) { | ||
} | ||
if (el !== null && el.length > 0 && !hasAttr(el, 'id')) { | ||
el.attr('id', '_controller' + num); | ||
num++; | ||
} | ||
return this.createController(path, el); | ||
@@ -362,0 +372,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161636
2129
+ Addedextended-spine@1.1.0(transitive)
- Removedextended-spine@1.0.4(transitive)
Updatedextended-spine@~1.1.0