src_js/iconolab-bundle/src/components/collectionselector/CollectionSelector.vue
author durandn
Thu, 06 Oct 2016 15:07:50 +0200
changeset 212 1c7cce196665
child 263 ab794183f134
permissions -rw-r--r--
Added complete_description attribute to Collection for homepage #12 + Vue.js components to handle display and sart to harmonize javascript

<script>

export default {
	data () {
		return {}
	},
	mounted () {
		var self=this;
		$(".collection-container").hide();
		$(".collection-description-complete").hide();
	},
	methods: {
	 	pickCollection: function(name){
		    if (!$("#show-collection-"+name).hasClass("btn-primary")){
			    $("#main-panel").hide();
	     	    $(".collection-container").removeClass("selected");
	     	    $(".collection-container:not(.selected)").hide();
			    $(".collection-description-complete").hide()
			    $(".collection-description").show()
	     	    $(".btn-collection").removeClass("btn-primary")
	     	    $("#show-collection-"+name).addClass("btn-primary")
	     	    $(".collection-container#collection-panel-"+name).show()
	     	    $(".collection-container#collection-panel-"+name).addClass("selected")
		    }
		},
		showCompleteDescription: function(name){
		    $(".collection-description-complete").hide()
		    $("#collection-description-short-"+name).hide()
		    $("#collection-description-complete-"+name).show()
		},
		hideCompleteDescription: function(name){
		    $(".collection-description-complete").hide()
		    $("#collection-description-short-"+name).show()
		}
	}
}


</script>