On the backend Additional jQuery (without entwine) is not working on initial page load but it is working if you refresh the edit page.
Ok I have a completely fresh install of SS 3 v3.1.12
I create a Test Page type and add a Javascript
class TestPage extends Page {
private static $db = array(
);
public function getCMSFields() {
$fields = parent::getCMSFields();
Requirements::javascript("mysite/code/test.js");
return $fields;
}
}
class TestPage_Controller extends Page_Controller {
}
And the javascript page what just turns the MenuTitle into lowercase with underscores
(function($) {
$(document).ready(function(){
$('input[name=MenuTitle]').keyup(function () {
var textValue = $(this).val().toLowerCase();
textValue =textValue.replace(/ /g,"_");
$(this).val(textValue);
});
});
}(jQuery));
Now when I make the about us page this page type and I go to edit the MenuTitle (Navigation label) it is not working , but If I refresh the page while in edit it is working perfectly.
Is this by design or is this a bug?