{"size": 984, "ext": "js", "max_stars_repo_path": "server-core/src/main/java/io/onedev/server/web/page/project/blob/render/view/blob-view.js", "max_stars_repo_name": "parampavar/onedev", "max_stars_repo_stars_event_min_datetime": "2020-05-22T16:25:13.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-22T16:25:13.000Z", "max_issues_repo_path": "server-core/src/main/java/io/onedev/server/web/page/project/blob/render/view/blob-view.js", "max_issues_repo_name": "parampavar/onedev", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server-core/src/main/java/io/onedev/server/web/page/project/blob/render/view/blob-view.js", "max_forks_repo_name": "parampavar/onedev", "max_forks_repo_forks_event_min_datetime": "2019-01-13T05:02:37.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-13T05:02:37.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 26.5945945946, "max_line_length": 101, "alphanum_fraction": 0.6219512195}
onedev.server.blobView = {

	onDomReady: function(containerId) {
		var $blobView = $("#" + containerId + ">.blob-view");
		var $head = $blobView.find(">.head");
		var $body = $blobView.find(">.body");

	    if ($body.find(".autofit").length != 0)
	    	$body.css("overflow", "visible");
	    
		$blobView.on("getViewState", function(e) {
			return {scroll:{left: $body.scrollLeft(), top: $body.scrollTop()}};			
		});
		
		$blobView.on("setViewState", function(e, viewState) {
			if (viewState.scroll) {
				$body.scrollLeft(viewState.scroll.left);
				$body.scrollTop(viewState.scroll.top);
			}
		});
		
		$blobView.on("autofit", function(e, width, height) {
			$blobView.outerWidth(width);
			$blobView.outerHeight(height);
			
			height = $blobView.height()-$head.outerHeight();
			$body.outerWidth(width).outerHeight(height);
			$body.find(".autofit:visible").first().triggerHandler("autofit", [$body.width(), $body.height()]);
		});
	}, 
	
	onWindowLoad: function() {
		
	}

};
