From 07d3895e6d3557e97be0e51a647767ab4f4bbe48 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 22 Oct 2017 19:16:14 +0200 Subject: [PATCH] reorg --- Yavsc/Views/Shared/_Layout.cshtml | 8 ++++++ Yavsc/wwwroot/js/input-lib.js | 47 ++++++++++++++----------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Yavsc/Views/Shared/_Layout.cshtml b/Yavsc/Views/Shared/_Layout.cshtml index 3bc0a838..1af4e519 100755 --- a/Yavsc/Views/Shared/_Layout.cshtml +++ b/Yavsc/Views/Shared/_Layout.cshtml @@ -68,6 +68,14 @@ h6 { + + @RenderSection("header", required: false) diff --git a/Yavsc/wwwroot/js/input-lib.js b/Yavsc/wwwroot/js/input-lib.js index 1e90fa1d..212a4d7b 100644 --- a/Yavsc/wwwroot/js/input-lib.js +++ b/Yavsc/wwwroot/js/input-lib.js @@ -1,27 +1,22 @@ -+(function($) { - var allowCircleToBlog = function(e) { - var allow = $(this).prop('checked'); - var circleid = $(this).data('circle-id'); - var targetid = $(this).data('target-id'); - var auth = { CircleId: circleid, BlogPostId: targetid }; - var url = '/api/blogacl'; - if (!allow) url += '/' + circleid; - console.log(auth); - $.ajax({ - url: url, - type: allow ? 'POST' : 'DELETE', - data: JSON.stringify(auth), - contentType: "application/json;charset=utf-8", - success: function(data) { - console.log('auth ' + allow ? 'POSTED' : 'DELETED' + data); - }, - error: function() { - console.log('Error @' + allow ? 'POSTed' : 'DELETEd'); - } - }); - e.preventDefault(); - }; - $(document).ready(function() { - $('input.Blogcirle[type=checkbox]').on('change', allowCircleToBlog); +var allowCircleToBlog = function(e) { + var allow = $(this).prop('checked'); + var circleid = $(this).data('circle-id'); + var targetid = $(this).data('target-id'); + var auth = { CircleId: circleid, BlogPostId: targetid }; + var url = '/api/blogacl'; + if (!allow) url += '/' + circleid; + console.log(auth); + $.ajax({ + url: url, + type: allow ? 'POST' : 'DELETE', + data: JSON.stringify(auth), + contentType: "application/json;charset=utf-8", + success: function(data) { + console.log('auth ' + allow ? 'POSTED' : 'DELETED' + data); + }, + error: function() { + console.log('Error @' + allow ? 'POSTed' : 'DELETEd'); + } }); -})(jQuery); \ No newline at end of file + e.preventDefault(); +} \ No newline at end of file