I have a Flexible Content field that is pre-populated with rows. I want to prevent the first row from being sortable or a drop target. To do this I need to modify the addSortable
function of the model (acf-pro-input.js line 601) to this:
addSortable: function( self ){
...
// add sortable
this.$layoutsWrap().sortable({
items: '> .layout:not([data-layout="intro"])', // Modified
...
});
},
Is there a built-in method for just changing a single function of a Field model/class? I don’t think creating a new model is the right way, or is it?
I don’t think that you can modify this.
Not sure if it can be done, but I would look into removing the .sortable from the specific element on one of the acf JS action hooks. https://www.google.com/search?q=jquery+remove+.sortable