From e3c27df6987bb644d286cb1760ace5e5e33734a1 Mon Sep 17 00:00:00 2001 From: Wired Earp Date: Thu, 15 Mar 2018 16:52:53 +0100 Subject: [PATCH] Channeling inline spirit for real this time --- docs/dist/sri.json | 4 ++-- .../spiritual/spiritual-gui/general/channeling.spec.js | 10 ++++++++++ .../channeling/gui.Assistant.js | 7 +++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/dist/sri.json b/docs/dist/sri.json index a4479ecc1..5a67591e1 100644 --- a/docs/dist/sri.json +++ b/docs/dist/sri.json @@ -1,9 +1,9 @@ { "@js": { "hashes": { - "sha384": "CJBf5i8idVm7hx8SVH9CTWGbIVMpKGUWgDeZuZohBw3J8N/IG8xMUMMNDYa2p90P" + "sha384": "2CU9+cqX1LT3T2R1nFt8RddO1HgT8+cWx6pbhTMcIkCSqCejeN/fIA69gGyoUrZ5" }, - "integrity": "sha384-CJBf5i8idVm7hx8SVH9CTWGbIVMpKGUWgDeZuZohBw3J8N/IG8xMUMMNDYa2p90P", + "integrity": "sha384-2CU9+cqX1LT3T2R1nFt8RddO1HgT8+cWx6pbhTMcIkCSqCejeN/fIA69gGyoUrZ5", "path": "public/ts-10.0.13.min.js" }, "@css": { diff --git a/spec/spiritual/spiritual-gui/general/channeling.spec.js b/spec/spiritual/spiritual-gui/general/channeling.spec.js index 59cd1ef4f..2e5e5b2d8 100644 --- a/spec/spiritual/spiritual-gui/general/channeling.spec.js +++ b/spec/spiritual/spiritual-gui/general/channeling.spec.js @@ -62,6 +62,16 @@ describe('Channeling and exorcising spirits', function likethis() { }); }); + it('should possess the inline spirit (not channeled)', function(done) { + window.MySpirit = ts.ui.Spirit.extend(); + var sandbox = this.sandbox; + sandbox.innerHTML = '
'; + sometime(function later() { + expect(hasSpirit(sandbox.firstChild)).toBe(true); + done(); + }); + }); + it('should possess on appendChild', function() { var elm = getSpiritElm(); this.sandbox.appendChild(elm); diff --git a/src/spiritual/spiritual-gui/gui-spirits@wunderbyte.com/channeling/gui.Assistant.js b/src/spiritual/spiritual-gui/gui-spirits@wunderbyte.com/channeling/gui.Assistant.js index 0d6542524..163ce60a8 100644 --- a/src/spiritual/spiritual-gui/gui-spirits@wunderbyte.com/channeling/gui.Assistant.js +++ b/src/spiritual/spiritual-gui/gui-spirits@wunderbyte.com/channeling/gui.Assistant.js @@ -150,10 +150,9 @@ gui.Assistant = (function using(Crawler) { */ _spiritconstructor: function(thing) { return ( - typeof thing === 'object' && - thing.ancestors && - typeof thing.ancestors === 'function' && - thing.ancestors().indexOf(gui.Spirit) > -1 + typeof thing === 'function' && + thing.$classname && + gui.Class.ancestors(thing).indexOf(gui.Spirit) > -1 ); } };