Last active
May 26, 2021 17:13
-
-
Save chdenat/c869409ca80cee64e6de443bb2b8b02d to your computer and use it in GitHub Desktop.
There was no method to clear all the rows of a repeater ... This is a new Field prototype method
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
/** | |
* empty function for acf.Field ie, it clears all the existing rows | |
* | |
* Only for repeater | |
* | |
* @returns {boolean} | |
* | |
* @author : Christian Denat | |
* @email : [email protected] / [email protected] | |
* | |
* @date : 20210526 | |
* | |
*/ | |
acf.Field.prototype.empty = function() { | |
if ('repeater' !== this.type) { | |
return false; | |
} | |
this.$('tbody:first tr:not(.acf-clone)').empty(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment