Changelog ========= All notable changes to this project will be documented in this file. This project mostly adheres to [Semantic Versioning](http://semver.org/). Unreleased ---------- ### Compatible changes ### Breaking changes 0.18.0 ------ ### Compatible changes - New UJS attribute [`[up-toggle]`](/up-toggle) to show or hide part of a form if certain options are selected or boxes are checked. - Links can now have an optional `up-confirm` attribute. This opens a confirmation dialog with the given message before the link is followed or the modal/popup is opened. - New function [`up.off`](/up.off). This unregisters an event listener previously bound with [`up.on`](/up.on). - If a container contains more than one link, you can now set the value of the [`up-expand`](/up-expand) attribute to a CSS selector to define which link should be expanded. - You can now configure a list of idempotent HTTP methods in [`up.proxy.config.safeMethods`](/up.proxy.config). The proxy cache will only cache idempotent requests and will clear the entire cache after a non-idempotent request. - Loading modals and popups will now open if there is a fragment update between the modal/popup's request and response. - [`up.follow`](/up.follow) and [`up.replace`](/up.replace) now have an option `{ failTarget }`. Use it to define the selector to replace if the server responds with a non-200 status code. - [`[up-target]`](/up-target) and [`up-follow`](/up.replace) now have a modifying attribute `up-fail-target`. Use it to define the selector to replace if the server responds with a non-200 status code. - New utility method [`up.util.reject`](/up.util.reject) - New utility method [`up.util.only`](/up.util.only) - New utility method [`up.util.except`](/up.util.except) - Fix a bug where modals could no longer be opened on some browsers ### Breaking changes - By default Up.js now converts `PUT`, `PATCH` and `DELETE` requests to `POST` requests that carry their original method in a form parameter named `_method`. This is to [prevent unexpected redirect behavior](https://makandracards.com/makandra/38347). Web frameworks like Ruby on Rails or Sinatra are aware of the `_method` parameter and use its value as the method for routing. You can configure this behavior in [`up.proxy.config.wrapMethods`](/up.proxy.config) and [`up.proxy.config.wrapMethodParam`](/up.proxy.config). - The requested selector is now sent to the server as a request header `X-Up-Target` (this used to be `X-Up-Selector`). If you are using `upjs-rails`, you can access it through `up.target` (this used to be `up.selector`). 0.17.0 ------ ### Compatible changes - When used with the [Ruby on Rails unobtrusive scripting adapter](https://github.com/rails/jquery-ujs) (`rails_ujs.js`), now prevents duplicate form submission when Up.js attributes are mixed with `data-method` attributes. - [`[up-instant]`](/up-instant) now works with modals and popups - [`[up-expand]`](/up-expand) now works with modals and popups ### Breaking changes - When [`up.observe`](/up.observe) is used with a delay of zero, the callback is invoked instantly (instead of being invoked in the next animation frame). 0.16.0 ------ ### Compatible changes - You can now configure [`up.proxy.config.maxRequests`](/up.proxy.config) to limit the maximum number of concurrent requests. Additional requests are queued. This currently ignores preloading requests. You might find it useful to set this to `1` in full-stack integration tests (e.g. Selenium). - Allow to disable animations globally with `up.motion.enabled = false`. This can be useful in full-stack integration tests like a Selenium test suite. - New function [`up.motion.isEnabled`](/up.motion.isEnabled) to check if animations will be performed. - [`up.popup.attach`](/up.popup.attach) now throws a helpful error when trying to attach a popup to a non-existing element - New option [`up.modal.config.history`](/up.modal.config) to configure if modals change the browser URL (defaults to `true`) - New option [`up.popup.config.history`](/up.popup.config) to configure if popup change the browser URL (defaults to `false`). - Fix CSS for popups with a position of `"bottom-left"`. ### Breaking changes - Popups and modals used to close automatically whenever an element behind the overlay was replaced. This behavior is still in effect, but only if the replacement was triggered by a link or element from within the popup or modal. - Popups and modals no longer raise an error if their (hidden) overlay was closed before the response was received. - Popups and modals are now compiled before they are animated. 0.15.1 ------ ### Compatible changes - Fix an error where `up.form.config` was not published. This caused `up-bootstrap.js` to throw an error. 0.15.0 ------ ### Compatible changes - New function [`up.autosubmit`](/up.autosubmit) and selector [`[up-autosubmit]`](/up-autosubmit) to observe a form or field and submit the form when a value changes. - [`up.observe`](/up.observe) and [`[up-observe]`](/up-observe) can now be applied to `