{"action":"created","issue":{"url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/357","labels_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/357/comments","events_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/357/events","html_url":"https://github.com/ThemeFuse/Unyson/issues/357","id":61244658,"number":357,"title":"How to dynamical set typography font?","user":{"login":"danyj","id":2340172,"avatar_url":"https://avatars.githubusercontent.com/u/2340172?v=3","gravatar_id":"","url":"https://api.github.com/users/danyj","html_url":"https://github.com/danyj","followers_url":"https://api.github.com/users/danyj/followers","following_url":"https://api.github.com/users/danyj/following{/other_user}","gists_url":"https://api.github.com/users/danyj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyj/subscriptions","organizations_url":"https://api.github.com/users/danyj/orgs","repos_url":"https://api.github.com/users/danyj/repos","events_url":"https://api.github.com/users/danyj/events{/privacy}","received_events_url":"https://api.github.com/users/danyj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"valeriuzdrobau","id":3817538,"avatar_url":"https://avatars.githubusercontent.com/u/3817538?v=3","gravatar_id":"","url":"https://api.github.com/users/valeriuzdrobau","html_url":"https://github.com/valeriuzdrobau","followers_url":"https://api.github.com/users/valeriuzdrobau/followers","following_url":"https://api.github.com/users/valeriuzdrobau/following{/other_user}","gists_url":"https://api.github.com/users/valeriuzdrobau/gists{/gist_id}","starred_url":"https://api.github.com/users/valeriuzdrobau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeriuzdrobau/subscriptions","organizations_url":"https://api.github.com/users/valeriuzdrobau/orgs","repos_url":"https://api.github.com/users/valeriuzdrobau/repos","events_url":"https://api.github.com/users/valeriuzdrobau/events{/privacy}","received_events_url":"https://api.github.com/users/valeriuzdrobau/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-03-13T21:14:09Z","updated_at":"2015-03-14T17:35:02Z","closed_at":null,"body":"I have tried many options and this selctize is lots of trouble. \r\nHow do I set  the selected font . Normal select is \r\n\r\n\r\n    $('select').val('Arial').trigger('change);\r\n\r\nBut according to selectize api we need to recreate the whole html again. So I need to do this whole thing  \r\n\r\nhttps://github.com/ThemeFuse/Unyson/blob/master/framework/includes/option-types/typography/static/js/scripts.js#L5\r\n\r\nrebuild the select, set new selectize value\r\n\r\n        \r\n\tvar $select \t= $('select').html(fontsHTML).selectize();\r\n\tvar selectize \t= $select[0].selectize;\r\n\tselectize.setValue(value);\r\n\r\nAnd that adds on again to the page speed.\r\n\r\nAnother issue is this  timeout\r\n\r\nhttps://github.com/ThemeFuse/Unyson/blob/master/framework/includes/option-types/typography/static/js/scripts.js#L40\r\n\r\nwhich completely kills my \r\n\r\n   $(document).on('ready'....\r\n\r\nand in order to set the font again I must do timeout of about 2/3 sec. \r\n\r\nPlease provide some kind of solution. "},"comment":{"url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/comments/80623279","html_url":"https://github.com/ThemeFuse/Unyson/issues/357#issuecomment-80623279","issue_url":"https://api.github.com/repos/ThemeFuse/Unyson/issues/357","id":80623279,"user":{"login":"danyj","id":2340172,"avatar_url":"https://avatars.githubusercontent.com/u/2340172?v=3","gravatar_id":"","url":"https://api.github.com/users/danyj","html_url":"https://github.com/danyj","followers_url":"https://api.github.com/users/danyj/followers","following_url":"https://api.github.com/users/danyj/following{/other_user}","gists_url":"https://api.github.com/users/danyj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyj/subscriptions","organizations_url":"https://api.github.com/users/danyj/orgs","repos_url":"https://api.github.com/users/danyj/repos","events_url":"https://api.github.com/users/danyj/events{/privacy}","received_events_url":"https://api.github.com/users/danyj/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T17:35:02Z","updated_at":"2015-03-14T17:35:02Z","body":"Works in console because load is done, \r\n\r\nPlace it in js file and it will not fire. You will have to do timeout.\r\nThis is files order \r\n\r\nhttp://prntscr.com/6gpsq8\r\n\r\nthztypo is same as your typography \r\nthz.admin.js  is placed last and on \r\ndoc ready I am trying to change the select value. \r\n\r\nI placed your code in thz.admin.js and it does not fire unless there is timeout. \r\n\r\nIf I dont use selectize \r\nA simple \r\n\r\n\t$('select').val('Arial').trigger('change);\r\n\r\nin thz.admin.js works perfect. "}}