Sha256: 77b9edb6e473a550223a5779dd48fadbb2c8b4b12afc6335a1dfdf40ff3d87fc

Contents?: true

Size: 708 Bytes

Versions: 5

Compression:

Stored size: 708 Bytes

Contents

$(function(){
	if($('#navigations-new, #navigations-edit').length <= 0){
		return;
	}

	$('#navigation_page_id').select2({
		language: 'zh-CN',
    placeholder: '无',
    allowClear: true,
		ajax: {
			url: '<%= Blacksand::Engine.routes.url_helpers.search_pages_path(format: :json) %>',
			dataType: 'json',
			delay: 250,
			data: function (params) {
				return {
					'q[title_cont]': params.term, // search term
					page: params.page
				};
			},
			processResults: function (data, params) {
				params.page = params.page || 1;

				return {
					results: data.pages,
					pagination: {
						more: params.page < data.total_pages
					}
				};
			},
			cache: false
		},
		minimumInputLength: 1
	});
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacksand-2.5.0 app/assets/javascripts/blacksand/dashboard/navigations.form.js.erb
blacksand-2.4.1 app/assets/javascripts/blacksand/dashboard/navigations.form.js.erb
blacksand-2.4.0 app/assets/javascripts/blacksand/dashboard/navigations.form.js.erb
blacksand-2.3.0 app/assets/javascripts/blacksand/dashboard/navigations.form.js.erb
blacksand-2.2.2.1 app/assets/javascripts/blacksand/dashboard/navigations.form.js.erb