]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update apps/files_versions/js/versions.js
authormaelzx <maelzx@gmail.com>
Wed, 20 Feb 2013 03:14:24 +0000 (11:14 +0800)
committermaelzx <maelzx@gmail.com>
Wed, 20 Feb 2013 03:14:24 +0000 (11:14 +0800)
Fix "All version..." button not clickable.

Reason is Google Chrome blocking inline javascript execution.

apps/files_versions/js/versions.js

index b9c54689813be409332a467055674047cf8dd0e5..dec222eefce64988d5332bf838a6c59873ee447f 100644 (file)
@@ -41,6 +41,10 @@ $(document).ready(function(){
        }
 });
 
+function goToVersionPage(url){
+       window.location(url);
+}
+
 function createVersionsDropdown(filename, files) {
 
        var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename );
@@ -51,7 +55,7 @@ function createVersionsDropdown(filename, files) {
        html += '<option value=""></option>';
        html += '</select>';
        html += '</div>';
-       html += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />';
+       html += '<input type="button" value="All versions..." name="makelink" id="makelink" />';
        html += '<input id="link" style="display:none; width:90%;" />';
 
        if (filename) {
@@ -60,6 +64,10 @@ function createVersionsDropdown(filename, files) {
        } else {
                $(html).appendTo($('thead .share'));
        }
+       
+       $("#makelink").click(function() {
+               goToVersionPage(historyUrl);    
+       });
 
        $.ajax({
                type: 'GET',