Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@amnesty/modal
Advanced tools
Generic modal for Amnesty International Swedish website
This module has two usecases:
In your webpage script you can have the modal open the iframe for you by calling the static method open
.
var Modal = require('@amnesty/modal')
var link = document.querySelector('.js-link')
link.addEventListener('click', function () {
Modal.open(link.href)
})
The webpage that is loaded in the iframe should create a modal and mount the modal on the body
element. A modal created with the root
option will automatically mount on the body
when rendered, otherwise it will appended to the body
.
An optional callback can be supplied to the render method which will be called if the modal is closed by clicking outside main window.
var html = require('nanohtml')
var Modal = require('@amnesty/modal')
var modal = new Modal({root: true, static: true})
modal.render(html`
<div>
<h1>Hello world!</h1>
</div>
`, onclose)
function onclose () {
console.log('bye!')
}
The modal is built on nanocomponent and all methods of nanocomponent are supported.
modal = new Modal([opts])
Creates a new Modal instance. Takes an optional object with options.
root
Make the modal outer most element a body
tagstatic
Prevent initial background transitionModal.open(href)
Preload an iframe and display it fullscreen.
modal.render([child, [onclose]])
Render modal element. Takes an optional child element and an callback for when the modal is closed by clicking outside the main window. Returns the modal element.
modal.close([onclose])
Close the modal. Takes an optinoal callback that is called once the modal is closed.
There's an example in the /examples
folder which illustrates the typical setup.
$ npm run example
$ npm install --save @amnesty/modal
FAQs
Generic modal for Amnesty International Swedish website
The npm package @amnesty/modal receives a total of 8 weekly downloads. As such, @amnesty/modal popularity was classified as not popular.
We found that @amnesty/modal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.