<div class="modal-header">
    <strong class="modal-title">Move files to ... </strong>
</div>
<div class="modal-body">
    <form role="form">
        <div class="form-group">
            <strong>Files selected to move:</strong>
            <table class="table table-hover table-striped tablefont" id="filesTree">
                <tbody>
                    <tr data-ng-repeat="folder in folderdata">
                        <td><i class="fa fa-folder" style="color:#dfba49"></i> {{folder}}</td>
                    </tr>
                    <tr data-ng-repeat="file in filedata">
                        <td><i class="fa fa-file"></i> {{file}}</td>
                    </tr>
                </tbody>
            </table>
            <p class="text-muted"><small>Current files position {{path}}</small></p>
        </div>
        
        <div class="form-group {{(errorMessage != '') ? 'has-error' : ''}}">
            <label>New path</label>
            <div class="dropdown {{openDropdown}}">
                <div class="input-group">
                    <input type="text" class="form-control dropdown-toggle" data-ng-keyup="fastSearch(newpath)" data-toggle="dropup" data-ng-model="newpath" id="newPathInput" placeholder="Enter new path" autocomplete="off" data-ng-focus="inputSlash()" />
                    <span class="btn">
                        <i class="fa fa-check" data-ng-show="!apiSearch" data-ng-click="openDropdown=''"></i>
                        <img src="/themes/adminLTE/dist/img/waiting.gif" data-ng-show="apiSearch" style="width:14px;height:14px;">
                    </span>
                </div>
                <ul class="dropdown-menu {{openDropdown}}" style="padding: 5px;">
                    <li data-ng-repeat="folderFound in folderSearchList | filter : localSearch">
                    <a class="pointer" data-ng-show="folderFound.name != '..'" data-ng-click="fastSearchFast(folderFound.name)">{{folderFound.name}}</a>
                    </li>
                </ul>
            </div>
            <script>
                setTimeout(function(){
                    $('#newPathInput').focus();
                    var inputSlash = $('#newPathInput');
                    inputSlash.val("/").focus();
                    //angular.element($("body")).scope().fastSearch("/");
                    var scope = angular.element($('#newPathInput')).scope();
                    scope.$apply(function(){
                        scope.newpath = "/"
                        scope.fastSearch("//");
                        console.log("ab")
                    })
                }, 500)
            </script>
            <br/>
            <p class="help-block" data-ng-show="errorMessage != ''">{{errorMessage}}</p>
            <i class="help-block">For example: <b>/myFolder/testFolder/</b></i>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button class="btn btn-success btn-flat {{blockButtonsClass}}" ng-disabled="blockButtons" type="button" ng-click="move()">Move</button>
    <button class="btn btn-default btn-flat" type="button" ng-click="closeModal()">Cancel</button>
</div>