{"size": 1218, "ext": "js", "max_stars_repo_path": "src/strand-modal/strand-modal.js", "max_stars_repo_name": "rpjs/strand", "max_stars_repo_stars_event_min_datetime": "2015-04-20T17:24:30.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-19T11:42:15.000Z", "max_issues_repo_path": "src/strand-modal/strand-modal.js", "max_issues_repo_name": "rpjs/strand", "max_issues_repo_issues_event_min_datetime": "2015-04-21T18:11:26.000Z", "max_issues_repo_issues_event_max_datetime": "2018-01-04T17:22:23.000Z", "max_forks_repo_path": "src/strand-modal/strand-modal.js", "max_forks_repo_name": "rpjs/strand", "max_forks_repo_forks_event_min_datetime": "2015-04-20T17:25:19.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-01T08:29:25.000Z"}
{"max_stars_count": 157, "max_issues_count": 130, "max_forks_count": 56, "avg_line_length": 18.1791044776, "max_line_length": 112, "alphanum_fraction": 0.5968801314}
/**
 * @license
 * Copyright (c) 2015 MediaMath Inc. All rights reserved.
 * This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt

*/
/* strand-modal.js */
(function(scope) {

	scope.Modal = Polymer({
		is: 'strand-modal',

		behaviors:[
			StrandTraits.Falsifiable,
			StrandTraits.Resolvable,
			StrandTraits.Stackable,
			StrandTraits.Refable
		],

		properties: {
			stackType:{
				value: "modal"
			},
			hidden: {
				type:Boolean,
				value:true,
				notify:true,
				reflectToAttribute:true
			},
			dismiss: {
				type:Boolean,
				value:true,
				notify:true,
			},
			noscroll: {
				type:Boolean,
				value:false
			},
			width: {
				type:Number,
				value:600
			}
		},

		show: function() {
			this.hidden = false;

			if(this.noscroll) {
				document.body.style.overflow = "hidden";
			}
		},

		_widthStyle: function(width) {
			return "width:"+width+"px";
		},

		hide: function(e) {
			if (e) e = Polymer.dom(e);
			if (!e || this.dismiss && e.rootTarget === this.$.blocker || e.path.indexOf(this.$$("#close")) !== -1)  {
				this.hidden = true;
				document.body.style.overflow = "";
			}
		}
	});

})(window.Strand = window.Strand || {});
