-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(distribute-elements): use rules to determine if allowed
- Loading branch information
Showing
6 changed files
with
232 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import inherits from 'inherits-browser'; | ||
|
||
import RuleProvider from 'lib/features/rules/RuleProvider'; | ||
|
||
export default function TestRules(eventBus) { | ||
RuleProvider.call(this, eventBus); | ||
} | ||
|
||
TestRules.$inject = [ 'eventBus' ]; | ||
|
||
inherits(TestRules, RuleProvider); | ||
|
||
|
||
TestRules.prototype.init = function() { | ||
var self = this; | ||
|
||
this.addRule('elements.distribute', function(context) { | ||
return self._result; | ||
}); | ||
}; | ||
|
||
TestRules.prototype.setResult = function(result) { | ||
this._result = result; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import TestRules from './TestRules'; | ||
|
||
export default { | ||
__init__: [ 'testRules' ], | ||
testRules: [ 'type', TestRules ] | ||
}; |