Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var onChosenFileToOpen = function(theFileEntry) {
- $('.nav-tabs li:nth-child(' + $(".nav-tabs").children().length + ') a').click(); //synchronous function that creates a tab
- var checker=setInterval(()=>{
- if(currentiframe.contentWindow && currentiframe.contentWindow.editor){//waits those 2 conditions to be true
- currentiframe.contentWindow.readFileIntoEditor(theFileEntry)//content is loaded to that tab
- clearInterval(checker)
- }
- },1)};
- var callagain=true;
- var tabstocreate=[]
- var onChosenFileToOpen = function(theFileEntry) {
- tabstocreate.push(theFileEntry)
- thequeue();
- };
- function thequeue(){
- if(callagain===true && tabstocreate.length>0){
- $('.nav-tabs li:nth-child(' + $(".nav-tabs").children().length + ') a').click();
- var checker=setInterval(()=>{
- if(currentiframe.contentWindow.editor){
- currentiframe.contentWindow.readFileIntoEditor(tabstocreate[0])
- tabstocreate.shift()
- clearInterval(checker)
- callagain=true
- if(tabstocreate.length>0){
- letsgobb()
- }
- }
- },1)
- callagain=false
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement