https://github.com/backdrop-contrib/behavior_weights
Allows you to attach weights to your Backdrop behaviors.
https://github.com/backdrop-contrib/behavior_weights
backdrop backdropcms behavior cms weight
Last synced: 9 months ago
JSON representation
Allows you to attach weights to your Backdrop behaviors.
- Host: GitHub
- URL: https://github.com/backdrop-contrib/behavior_weights
- Owner: backdrop-contrib
- License: gpl-2.0
- Created: 2024-07-02T19:23:04.000Z (over 1 year ago)
- Default Branch: 1.x-1.x
- Last Pushed: 2024-07-02T19:59:41.000Z (over 1 year ago)
- Last Synced: 2025-02-10T13:18:54.263Z (11 months ago)
- Topics: backdrop, backdropcms, behavior, cms, weight
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Behavior Weights
This is an API module. Only enable it if another module requires it, or if you
want to use the API with your own custom code.
## Installation and Usage
- Install this module using the [official Backdrop CMS instructions](https://backdropcms.org/guide/modules).
- Enable it.
## Usage
In your own module's Javascript, you can write something like this:
```
(function(){
Backdrop.behaviors.mymodule_early = {
attach: function (context, settings) {..},
weight: -11
};
})();
```
or
```
(function(){
Backdrop.behaviors.mymodule_early.weight = -9;
})();
```
The default weight is 0. Anything with a smaller weight will run earlier.
Anything with a higher weight will run later.
## Issues
Bugs and Feature requests should be reported in the [Issue Queue](https://github.com/backdrop-contrib/behavior_weights/issues)
## Current Maintainers
- [Laryn Kragt Bakker](https://github.com/laryn/)
## Credits
- Ported to Backdrop CMS by [Laryn Kragt Bakker](https://github.com/laryn/)
- The Drupal 7 version is created and maintained by [Andreas Hennings](https://github.com/donquixote)
## License
This project is GPL v2 software. See the LICENSE.txt file in this directory for
complete text.